10-21-2008 05:30 AM
10-24-2008 09:32 AM
package org.alfresco.web.action.evaluator;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.model.ForumModel;
import org.alfresco.service.cmr.security.PermissionService;
public class ForbidEditPostsEvaluator extends BaseActionEvaluator {
private static final long serialVersionUID = -503423291648992513L;
/**
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
*/
public boolean evaluate(final Node node)
{
if(node.getType().equals(ForumModel.TYPE_POST) || node.getType().equals(ForumModel.TYPE_TOPIC))
return node.hasPermission(PermissionService.COORDINATOR);
else
return true;
}
}
<!– Edit an existing Post –>
<action id="edit_post">
<!– <permissions>
<permission allow="true">Write</permission>
</permissions> –>
<evaluator>org.alfresco.web.action.evaluator.ForbidEditPostsEvaluator</evaluator>
<label-id>edit_post</label-id>
<image>/images/icons/edit_post.gif</image>
<action>dialog:editPost</action>
<action-listener>#{BrowseBean.setupContentAction}</action-listener>
<params>
<param name="id">#{actionContext.id}</param>
</params>
</action>
<!– Delete a Post –>
<action id="delete_post">
<!– <permissions>
<permission allow="true">Delete</permission>
</permissions> –>
<evaluator>org.alfresco.web.action.evaluator.ForbidEditPostsEvaluator</evaluator>
<label-id>delete_post</label-id>
<image>/images/icons/delete.gif</image>
<action>dialog:deleteFile</action>
<action-listener>#{BrowseBean.setupContentAction}</action-listener>
<params>
<param name="id">#{actionContext.id}</param>
</params>
</action>
11-19-2008 06:10 PM
Hi,I'm no expert, but a declaration in the permissionDefinitions.xml file says that content owners can do whatever they want if they're the owner (as per the following line in webapps/alfresco/WEB-INF/classes/alfresco/model/permissionDefinitions.xml):
I want to configure the actions of the forums in order to forbid the users to edit or delete their posts.
<!– For now, owners can always see, find and manipulate their stuff –>
<globalPermission permission="FullControl" authority="ROLE_OWNER"/>
<!– A contributor can create content and then they have full permission on what –>
<!– they have created - via the permissions assigned to the owner. –>
<permissionGroup name="Contributor" allowFullControl="false" expose="true" >
<!– Contributor is a consumer who can add content, and then can modify via the –>
<!– owner permissions. –>
<includePermissionGroup permissionGroup="Consumer" type="cm:cmobject"/>
<includePermissionGroup permissionGroup="AddChildren" type="sys:base"/>
<includePermissionGroup permissionGroup="ReadPermissions" type="sys:base" />
</permissionGroup>
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.