package org.alfresco.delegation.evaluator;
import javax.faces.context.FacesContext;
import org.alfresco.delegation.aspects.DelegIGRootAspect;
import org.alfresco.service.cmr.security.AccessStatus;
import org.alfresco.service.cmr.security.AuthenticationService;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.web.action.ActionEvaluator;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
public class DirAccessEvaluator implements ActionEvaluator
{
public boolean evaluate(Node node)
{
AuthenticationService auth = Repository.getServiceRegistry(
FacesContext.getCurrentInstance()).getAuthenticationService();
// don't do anything if it's root og an IG
if (!node.hasAspect(DelegIGRootAspect.ASPECT_IGROOT))
{
return false;
}
if (auth.isCurrentUserTheSystemUser())
{
return false;
}
// check if LeaderCI
PermissionService permService = Repository.getServiceRegistry(
FacesContext.getCurrentInstance()).getPermissionService();
if (permService.hasPermission(node.getNodeRef(), "DirAccess") == AccessStatus.ALLOWED &&
permService.hasPermission(node.getNodeRef(), "DirManageMembers") != AccessStatus.ALLOWED )
{
return true;
}
return false;
}
}
<!– go to the page chowing users access profile no edition alowed –>
<action id="access_dir">
<evaluator>
org.alfresco.delegation.evaluator.DirAccessEvaluator
</evaluator>
<label-id>access_dir</label-id>
<image>/images/extension/icons/invite_deleg_users.gif</image>
<action>dialog:manageDelegInvitedUsers</action>
<action-listener>#{BrowseBean.setupSpaceAction}</action-listener>
<params>
<param name="id">#{actionContext.id}</param>
</params>
</action>
La technique que je suggère est d’utiliser les groupes et de montrer ou cacher l’item de menu en fonction de l’appartenance ou pas de l’utilisateur à un groupe. Ceci donne plus de souplesse cas si un item est bridé comme décrit précédemment il est bridé pour tous les utilisateurs !!! La technique des groupes permet également d’avoir une interface d’administration « gratuite » au travers l’administration des groupes et des utilisateurs. <!– Action for adding content - quick upload –>
<action-group id="add_content_menu">
<style>white-space:nowrap</style>
<action idref="add_adm_content" />
</action-group>
<nobr>
<r:permissionEvaluator value="#{NavigationBean.currentNode}" allow="CreateChildren" id="eval2">
<a:actionLink value="#{msg.add_content}" image="/images/icons/add.gif" padding="2" action="addContent" actionListener="#{AddContentDialog.start}" style="white-space:nowrap" id="link3" />
</r:permissionEvaluator>
</nobr>
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.