Skip to content

Set layer permission using REST API #12773

Closed Answered by gannebamm
jonsken asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @jonsken,
Here are some examples with curl:

to make RESSOURCE-ID public:

curl -u admin:PASS --location --request PUT 'https://stable.demo.geonode.org/api/v2/resources/RESSOURCE-ID/permissions' --header 'Content-Type: application/json' --data-raw '{"groups": [],"organizations": [],"users": [{"id": -1,"permissions": "view"}]}'

To make RESSOURCE-ID private:

curl -u admin:PASS --location --request PUT 'https://stable.demo.geonode.org/api/v2/resources/RESSOURCE-ID/permissions' --header 'Content-Type: application/json' --data-raw '{"groups": [],"organizations": [],"users": [{"id": -1,"permissions": ""}]}'

You shall check the user.id you would like to grant permissions to.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jonsken
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants