Details
-
Bug
-
Resolution: Invalid
-
Major
-
None
-
12.10.10, 13.10.2
-
Unknown
-
N/A
-
N/A
-
Description
For a REST POST request for the URL "rest/wikis/
{wikiName}/spaces/XWiki/pages/XWikiPreferences/objects" the answer is always with the same object ID.
Example of the property "href" in the answer :
{{"href":"
/rest/wikis/{wikiName}
/spaces/XWiki/pages/XWikiPreferences/objects/XWiki.XWikiGlobalRights/2"}}
Test with CURL (Supposed you have a wiki named "projetbidon" :
WIKI="projetbidon" echo "Get instances of XWiki.XWikiGlobalRights for wiki "$WIKI curl -u $USER_REST \ -X GET \ -H "Content-type: application/x-www-form-urlencoded" \ -H "Accept: application/json" \ $URI_REST/wikis/$WIKI/spaces/XWiki/pages/XWikiPreferences/objects/XWiki.XWikiGlobalRight?media=json; echo "Add an instance of XWiki.XWikiGlobalRights for wiki "$WIKI curl -u $USER_REST \ -X POST \ -H "Content-type: application/x-www-form-urlencoded" \ -H "Accept: application/json" \ -d "className=XWiki.XWikiGlobalRights" \ -d "property#allow=1" \ -d "property#groups=groupe_bidon_1" \ -d "property#levels=login,view,edit,delete,creator,register,comment,script,admin,createwiki,programming" \ $URI_REST/wikis/$WIKI/spaces/XWiki/pages/XWikiPreferences/objects?media=json; echo "Add a another instance of XWiki.XWikiGlobalRights for wiki "$WIKI curl -u $USER_REST \ -X POST \ -H "Content-type: application/x-www-form-urlencoded" \ -H "Accept: application/json" \ -d "className=XWiki.XWikiGlobalRights" \ -d "property#allow=1" \ -d "property#groups=groupe_bidon_2" \ -d "property#levels=login,view,edit" \ $URI_REST/wikis/$WIKI/spaces/XWiki/pages/XWikiPreferences/objects?media=json; echo "Get list of objects XWiki.XWikiGlobalRight" curl -u $USER_REST \ -X GET \ -H "Content-type: application/x-www-form-urlencoded" \ -H "Accept: application/json" \ $URI_REST/wikis/$WIKI/spaces/XWiki/pages/XWikiPreferences/objects/XWiki.XWikiGlobalRights?media=json; # Problem here the object with "property#groups=groupe_bidon_1" is not listed