<div dir="ltr">Hi Devs,<div><br></div><div>It seems I can achieve my goal by deleting some records in the geonode db. I know it is quite dangerous so I'm posting it here for advice from you.</div><div><br></div><div>So, for instance, if I want to remove the capability to download uploaded documents by non-registered users I should:</div><div><p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><font face="monospace">DELETE FROM guardian_userobjectpermission WHERE object_pk = '523' AND permission_id = 162 AND user_id = '-1';</font></span></p></div><div><p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><font face="monospace">DELETE FROM guardian_groupobjectpermission WHERE object_pk = '523' AND permission_id = 162 AND group_id = '1';</font></span></p></div><div><br></div><div>Where 523 is one of the document I want to change the permissions and 162 is the download permission. Starting from this query I can change permissions in bulk.</div><div><br></div><div>Is it safe to proceed this way or is there a management command for documents I can use?</div><div>Thanks!</div><div><br></div><div>Bye,</div><div><br></div><div>P.</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 17, 2021 at 5:14 PM Paolo Pasquali <<a href="mailto:paolo.pasquali@gmail.com">paolo.pasquali@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Dear devs,<div><br></div><div>I would like to set permissions in bulk for documents. For instance, I'd like that only a certain users group can download some documents or unregistered users cannot download any document.</div><div><br></div><div>While the cart is available on the layers page only, I wonder if the set_layers_permissions command [1] can be used on the documents as well. It seems not.</div><div><br></div><div>Any suggestion on how to proceed?</div><div><br></div><div>Thanks for your help.</div><div><br></div><div>Ciao</div><div><br></div><div>Paolo</div><div><br></div><div><br></div><div>[1] <a href="https://docs.geonode.org/en/master/admin/mgmt_commands/index.html#batch-sync-permissions" target="_blank">https://docs.geonode.org/en/master/admin/mgmt_commands/index.html#batch-sync-permissions</a></div></div>
</blockquote></div>