Unable to change the state of "Define Permission" in CMS_INPUT_PERMISSION
Author: vasanth
Publication Date: 1/23/2013 18:00
Hello All,
I have CMS_INPUT_PERMISSION element in the metadata and the i have few roles are there. Now I want to uncheck the Check box of "Define Permission" (Which is highlighted in the below image). I tried it through the bean shell but i couldn't able to that.

Please find my code for uncheck the "Define Permission " below
context.getStoreElemet ().getMetaFormData ().get (context.getProject ().getMasterLanguage (),"portal_roles").get ().setInherited (false);
But the above didn't uncheck the "Define Permission" check box.
Please let me know if there is any other way to change the state of the "Define Permission" check box.
Thank you,
Vasandharaj.
Tags: cms_input_permission, define, permission, setinherited
-
Author: marro - 1/24/2013 9:24
Hello Vasandharaj,
first of all you have to lock the StoreElement you want to edit:
elem = context.getStoreElement();elem.setLock(true);Then you have to retrieve the FormData, apply your changes and set the FormData back to the StoreElement. You want to set inherited to true to uncheck the checkbox.
formdata = elem.getMetaFormData();roles = formdata.get(context.getProject().getMasterLanguage (),"portal_roles").get();roles.setInherited(true);elem.setMetaFormData(formdata);The last step is to save and unlock the StoreElement:
elem.save();elem.setLock(false);After refreshing the element in the GUI you will see your changes.
Regards,
Donato
0
Vous devez vous connecter pour laisser un commentaire.
Commentaires
1 commentaire