Modifying or Adding ACL permissions on groups programatically | Community
Skip to main content
Anudeep_Kumar
Level 2
August 12, 2023
Solved

Modifying or Adding ACL permissions on groups programatically

  • August 12, 2023
  • 3 replies
  • 1579 views

Hi All,

is there any way to update/revoke ACL permission for a particular user groups create in AEM programmatically. I have found few references using CURL commands but is there any other way using Java.

Thanks in Advance.

Regards,
Anudeep

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by mahi1729

May not be ideal for your usecase, but adoption of one of the access control management tools may make your life easier. See link - https://github.com/Netcentric/accesscontroltool/blob/develop/docs/Comparison.md . Basically if you use Netcentric's ACL management  through src code check-ins, probably updating those config files will automatically update ACLs once you push the packages to AEM. Yes, this takes some initial effort to setup, but becomes easier to manage when you have so many grps to manage within your org. We started using this in or our org with inputs from our architect, and find very easy to manage and easy to adopt. Thanks

3 replies

sherinregi-1
Community Advisor
Community Advisor
August 12, 2023

Hi @anudeep_kumar 

As you have mentioned CURL commands is something you can use in order to perform update on the user and group node.

In case if you are looking specifically for java please try to tweak on the snippets available in below url.

https://unlocklearning.in/aem-user-group-creation-and-permission-programmatically/#:~:text=given%20path%22)%3B-,Addition%20of%20ACL%20permission%20to%20a%20group%20for%20specific%20path,users%20present%20in%20that%20group.

 

Here usermanager is used and also adapted to various object types to perform user and groups operations.

 

mahi1729
mahi1729Accepted solution
Level 4
August 14, 2023

May not be ideal for your usecase, but adoption of one of the access control management tools may make your life easier. See link - https://github.com/Netcentric/accesscontroltool/blob/develop/docs/Comparison.md . Basically if you use Netcentric's ACL management  through src code check-ins, probably updating those config files will automatically update ACLs once you push the packages to AEM. Yes, this takes some initial effort to setup, but becomes easier to manage when you have so many grps to manage within your org. We started using this in or our org with inputs from our architect, and find very easy to manage and easy to adopt. Thanks

arunpatidar
Community Advisor
Community Advisor
August 14, 2023

instead of modifying permissions on run time, you could have created a static group with some predefined permissions(allow/deny) and programatically added user to this group.

Arun Patidar