Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to give user permissions programmatically?

I know I can give permissions in

${host}:4502/useradmin

when I double click user login and go to Permissions tab

I want to give permissions when I deploy content package.

Is it possible?

like image 939
gstackoverflow Avatar asked Jul 23 '15 12:07

gstackoverflow


People also ask

How do I set permissions in android programmatically?

You need to declare the permissions in the manifest file first before you request for them programmatically. refer this for more information. declaring the permission in the manifest file is static type declaration by which your os know what kind of permission your app might require.

How do I request runtime permission on Android?

Requesting Android Runtime Permissions For this the following method needs to be called on every permission. checkSelfPermission(String perm); It returns an integer value of PERMISSION_GRANTED or PERMISSION_DENIED.


1 Answers

When you give permission for a user for a particular node/path , it basically stores the permission on the node level below the rep:policy node (allow/deny).

I want to give permissions when I deploy content package.

  • You can deploy an AEM package containing only rep:policies which will serve the same purpose of setting up permissions through useradmin.

You can refer to ACL packager from ACS Tools for packaging ACLs.

Note : The user who is installing the package needs to have permission to set ACLs

To programmatically set ACLs (as the title of your question says), you might care to check out few Jackrabbit/JCR interfaces/classes .

org.apache.jackrabbit.api.security.JackrabbitAccessControlManager
org.apache.jackrabbit.api.security.JackrabbitAccessControlList
javax.jcr.security.Privilege
like image 192
Sabya Avatar answered Sep 28 '22 04:09

Sabya