cancel
Showing results for 
Search instead for 
Did you mean: 

Strange behaviour of PermissionService?

enrico_it
Champ in-the-making
Champ in-the-making
Hello,

I am using the PermissionService in my project.
I usually code-manage (I am talking about Java code) the permissions, and then use the native web frontend to check the changes.
I have noticed a strange behaviour when managing the WRITE_PROPERTIES permission on a FOLDER node.
These are the steps performed by my code on the node.
- disable "permission inheritance".
- set READ_PROPERTIES with ALLOWED=true for a certain user, let's say user "A"
- set WRITE_PROPERTIES with ALLOWED=true for user "A"

Now, if I login with the user "A", I can see the properties, but I cannot edit them
The only way I have to edit the node properties is to add an additional step to the flow:
- set WRITE_CONTENT with ALLOWED=true for user "A"

Now, maybe I have misunderstood the meaning of the permissions, but, I am pretty sure that a FOLDER node does not have the CONTENT property.
Is it a little bug, maybe in an evaluator, or have I understood nothing about permissions?
Thanks for the attention.
2 REPLIES 2

rivetlogic
Champ on-the-rise
Champ on-the-rise
Hi,

This is not a strange behavior.

permissionDefinitions.xml defines "Write"  as below


<permissionGroup name="Write" expose="true" allowFullControl="false">
           <includePermissionGroup type="sys:base" permissionGroup="WriteProperties"/>
           <includePermissionGroup type="sys:base" permissionGroup="WriteContent"/>
</permissionGroup> 


The web client is looking for "Write" to allow a user to edit properties.

space-details.jsp

                                 <f:facet name="title">
                                    <r:permissionEvaluator value="#{SpaceDetailsBean.space}" allow="Write">
                                       <a:actionLink id="titleLink1" value="#{msg.modify}" showLink="false" image="/images/icons/edit_properties.gif"
                                             action="dialog:editSpace" />
                                    </r:permissionEvaluator>
                                 </f:facet>

This should explain why you are not able to edit the properties with just WRITE_PROPERTIES.
Permission Model is sound. Just the UI will need some changes for your scenario.  Please note that Web client doesn't provide you with this granularity in setting just WRITE_PROPERTIES on a node.

Either you make the required changes to the web client code or consider checking against appropriate permissions in your custom UI before you show any edit icon for the properties.

I hope this helps.

Best Regards,
Shagul

enrico_it
Champ in-the-making
Champ in-the-making
I have understood perfectly.

I thank you very much for the answer!

Enrico