Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

How to prevent page locking (through user rights or other means)?

Avatar

Level 2

The question is really simple but I can't seem to find an easy answer to it.

How can I prevent a user from locking a page. Is there a simple way through which the option is removed from the different menu's? Can this be achieved through user rights? Other (simple) means? I know I can customise each menu - but I'd rather only do this as a last resort

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

This is easy, you need to

1. overlay /libs/wcm/core/content/sites/jcr:content/actions/selection/lockpage

2. create granite:rendercondition child node of /apps/wcm/core/content/sites/jcr:content/actions/selection/lockpage/ 

3. create privilege(granite/ui/components/foundation/renderconditions/privilege) node under granite:rendercondition

4. add properties to this node  refer Privilege — Granite UI 1.0 documentation

5. create a group which has readAccessControl or modifyAccessControl access or other access which you like for that lock button should display

JCR 2.0: 16 Access Control Management (Content Repository for Java Technology API v2.0)

Screen Shot 2018-05-31 at 2.26.58 PM.png

Screen Shot 2018-05-31 at 2.28.01 PM.png

you can do same for unlock node as well.



Arun Patidar

View solution in original post

5 Replies

Avatar

Employee

A locked page is unlocked only by the user who locked it , or an admin account. So yes the best way would be through user management.

Editing Page Content

Avatar

Level 2

Hi Ankush, I'm aware of what you're saying, but I'm asking exactly HOW I can prevent it from happening in the first place. You say it can be done through user management. Can you specify exactly how I can prevent a user from locking a page? What roles/rights should the user have to prevent this? This is the core question.

Avatar

Correct answer by
Community Advisor

This is easy, you need to

1. overlay /libs/wcm/core/content/sites/jcr:content/actions/selection/lockpage

2. create granite:rendercondition child node of /apps/wcm/core/content/sites/jcr:content/actions/selection/lockpage/ 

3. create privilege(granite/ui/components/foundation/renderconditions/privilege) node under granite:rendercondition

4. add properties to this node  refer Privilege — Granite UI 1.0 documentation

5. create a group which has readAccessControl or modifyAccessControl access or other access which you like for that lock button should display

JCR 2.0: 16 Access Control Management (Content Repository for Java Technology API v2.0)

Screen Shot 2018-05-31 at 2.26.58 PM.png

Screen Shot 2018-05-31 at 2.28.01 PM.png

you can do same for unlock node as well.



Arun Patidar

Avatar

Level 2

I was hoping not to have to overlay anything, but it's the best practical answer! Thank you for your effort!

Avatar

Employee Advisor

Techically it's an overlay, but you are actually using a documented way to do it. It's much more stable than overlaying Javascript functions.