There are 6 updates, 1 comment.
 
 
Rights API / cid:jira-generated-image-avatar-bf859082-6cdb-4e56-b1c2-1e23cf4a892a RIGHTSAPI-39 Closed

Impossible to remove all rights from an entity

 
View issue   ·   Add comment
 

6 updates

 
cid:jira-generated-image-avatar-2fbd5139-3630-446e-96b4-5c97a44d30c8 Changes by Anca Luca on 04/Sep/24 21:00
 
Summary: Removing Impossible to remove all right are not applied rights from an entity
Fix Version: 2.3
Description: Step to reproduce:

Add some rights

{code}
$services.security.rights.saveRules($someRules, $reference)
{code}

Clear all rights
{code}
$services.security.rights.saveRules([], $reference)
{code}

 Expected result: all right are removed as we pass an empty list

Currently the last call has no effect and all right are
keep kept .

Note this is due of a regression of this change: https://github.com/xwiki-contrib/api-rights/commit/0b20e3c6101579a40445330d2741844d6e7b0e34#diff-ac8e48f22cfc07a9dd85f96aeab85a8d00a58fdd6411e70e506154889091acb7R94
Resolution: Fixed
Tests: Integration
Status: Open Closed
 
 

1 comment

 
cid:jira-generated-image-avatar-2fbd5139-3630-446e-96b4-5c97a44d30c8 Anca Luca on 04/Sep/24 21:00
 

Josué Tille proposed and implemented a fix for this that is coherent with the original intention of the changes made for RIGHTSAPI-29 about the empty list, which was to make sure that no page (webpreferences page) is created if there is nothing to save.

I updated a little the tests to test for page presence after the call to saveRules() rather than check what functions are called, since the intention is that the page is not created, regardless of the function that gets called.