Affecting global rights with REST API

Hi,

I have tried to modify my user rights with REST API by sending these datas on a specific space :

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

But it is not working with this classname, it only works with XWiki.XWikiRights.

How can I give rights to a user on a page and its child pages using REST API ?

Thanks.

Global rights have no effect unless they are stored on a preference page. Suppose you have a page A.B.WebHome (you see it as A / B in the breadcrumb). You need to create the A.B.WebPreferences page to store the global rights (note that this one is a terminal page). See https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/ContentOrganization/#HTerminology .

I have verified that I could view the WebPreferences page from page “A” and page “A.B”, both are working.

I tried to set the rights again by REST and I still couldn’t see the rights affected to the user.

Are you sending the post/put REST request to the WebPreferences page? Is the WebPreferences page modified after the REST request?

I was sending to WebHome, changing it to WebPreferences worked.

That’s perfect, thank you very much :slight_smile: