Setting "allow" right after "deny" right with REST

Hello,

I am trying to set “allow” right to my user on a specific space with REST API but his previous right was a “deny” right on this same space.

I am sending this :

className=XWiki.XWikiGlobalRights&property#levels=view,edit,comment&property#users=XWiki.test_user&property#allow=1 

But rights won’t change and stay as “deny”. The only way I found to give “allow” rights is to manually change my user rights to “not set” (not allow or not deny) and then to call again the previous code.

Is it possible to do this only using REST and not doing the manual changes ?

Thanks.

EDIT : Also realized that I couldn’t set “admin” right from “allow” to “deny”

Could I get an answer ?

Am i doing something wrong or is it the normal way it works ?

I am still needing an answer, I never could change a “denied” right to something else with REST.

Hello,

I have the exact same issue on this, my XWiki version is 11.10.1

I didn’t notice the behavior on the admin right from the begining, but I am able to reproduce this one too.

It could be nice to get a return on this, thanks.

You should give more details if you want to be helped, like for instance the steps to reproduce, ideally using some command line tool like curl to make the REST request.

Thanks for reply, there is some details about the problem.

I’m using postman to make my rest calls, making operations on a new user TestApi, affected to XWikiAllGroup, visual of rights on the target space at this point =>

image

For setting rights on space named CNED, calling this endpoint on POST method:

http://*******/xwiki/rest/wikis/xwiki/spaces/CNED/pages/WebPreferences/objects

Here the KeyValue pairs I send :

{"key":"className","value":"XWiki.XWikiGlobalRights"}
{"key":"property#users","value":"XWiki.TestApi"}
{"key":"property#levels","value":"view,comment,edit,delete"}
{"key":"property#allow","value":"1"} 

Visible result :

(New user restriction, only one pic per answer, they are correctly allowed)

I’m doing same thing to deny levels by sending :

http://*******/xwiki/rest/wikis/xwiki/spaces/CNED/pages/WebPreferences/objects

Here the KeyValue pairs I send :

{"key":"className","value":"XWiki.XWikiGlobalRights"}
{"key":"property#users","value":"XWiki.TestApi"}
{"key":"property#levels","value":"view,comment,edit,delete"}
{"key":"property#deny","value":"1"} 

Visible result :

(New user restriction, only one pic per answer, they are correctly denied)

At this point, everything is OK. Let’s now try to allow one of this denied right

Here the KeyValue pairs I send :

{"key":"className","value":"XWiki.XWikiGlobalRights"}
{"key":"property#users","value":"XWiki.TestApi"}
{"key":"property#levels","value":"view"}
{"key":"property#allow","value":"1"} 

Result is still the same, whatever I’m trying to send, seem like nothing can overwrite a denied right.

Regards