You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/12/01 22:52:00 UTC

[jira] [Commented] (SOLR-13900) Permissions deleting works wrong

    [ https://issues.apache.org/jira/browse/SOLR-13900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17452074#comment-17452074 ] 

ASF subversion and git services commented on SOLR-13900:
--------------------------------------------------------

Commit fd6a057b2fe84fd39dae638c092af1f50385709f in lucene-solr's branch refs/heads/branch_8_11 from Timothy Potter
[ https://gitbox.apache.org/repos/asf?p=lucene-solr.git;h=fd6a057 ]

SOLR-13900: Reset index values on authorization rules after deleting by index (#434) (#2617)



> Permissions deleting works wrong
> --------------------------------
>
>                 Key: SOLR-13900
>                 URL: https://issues.apache.org/jira/browse/SOLR-13900
>             Project: Solr
>          Issue Type: Bug
>          Components: Authorization, security
>            Reporter: Yuliia Sydoruk
>            Assignee: Timothy Potter
>            Priority: Major
>             Fix For: main (9.0), 8.11.1
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> Permissions indexes in security.json file do not correspond to indexes while deleting.
> The line 
> {{(141) setIndex(p);}}
> in [https://github.com/apache/lucene-solr/blob/master/solr/core/src/java/org/apache/solr/security/AutorizationEditOperation.java] makes indexes renumber before deleting and it leads to wrong behavior.
> *USE CASE 1:*
> There are 2 new permissions added to security.json (with indexes 13 and 14):
> {code:java}
> ....
>       { 
>         "role":"admin", 
>         "name":"schema-edit", 
>         "index":12},
>       {
>         "collection":"<collectionName>",
>         "path":"/schema/*",
>         "role":"test-role",
>         "index":13},
>       {
>         "path":"/admin/collections",
>         "params":{"collection":["testCollection"]},
>         "role":"test-role",
>         "index":14}
> ....
> {code}
> Step 1: remove the permission with index=13; result: permission is deleted correctly, security.json is next:
> {code:java}
> ....
>       { 
>         "role":"admin", 
>         "name":"schema-edit", 
>         "index":12,
>       {
>         "path":"/admin/collections",
>         "params":{"collection":["testCollection"]},
>         "role":"test-role",
>         "index":14}
> ....
> {code}
> Step 2: try to remove the permission with index=14; result: "No such index: 14" error is returned.
> *USE CASE 2:*
> There are 3 new permissions added to security.json (with indexes 13, 14 and 15):
> {code:json}
> ....
>       { 
>         "role":"admin", 
>         "name":"schema-edit", 
>         "index":12},
>       {
>         "collection":"<collectionName>",
>         "path":"/schema/*",
>         "role":"test-role",
>         "index":13},
>       {
>         "path":"/admin/collections",
>         "params":{"collection":["testCollection"]},
>         "role":"test-role",
>         "index":14}, 
>       { 
>         "path":"/admin/collections", 
>         "params":\{"collection":["anotherTestCollection"]}, 
>         "role":"test-role", 
>         "index":15}
> ....
> {code}
> Step 1: remove the permission with index=13; result: permission is deleted correctly, security.json becomes next:
> {code:json}
> ....
>        { 
>         "role":"admin", 
>         "name":"schema-edit", 
>         "index":12},
>        {
>         "path":"/admin/collections", 
>         "params":{"collection":["testCollection"]}, 
>         "role":"test-role", "index":14}, 
>        { 
>         "path":"/admin/collections", 
>         "params":{"collection":["anotherTestCollection"]}, 
>         "role":"test-role", 
>         "index":15}
> ....
> {code}
>  
>  Step 2: try to remove the permission with index=14; result: permission with index 15 is deleted, which is *wrong*



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org