package pt.iscte.ci.zas; import java.util.HashSet; import java.util.Set; import net.sourceforge.fenixedu.applicationTier.IUserView; import net.sourceforge.fenixedu.domain.person.RoleType; import net.sourceforge.fenixedu.injectionCode.AccessControl; import pt.iscte.ci.zas.authorization.AccessControlled; import pt.iscte.ci.zas.authorization.AccessController; public aspect ConcreteAccessController extends AccessController { public IUserView currentPrincipal() { return AccessControl.getUserView(); } public Set currentPrincipalPermissions() { final Set permissions = new HashSet(); final IUserView userView = currentPrincipal(); if (userView != null) { for (final RoleType roleType : userView.getRoleTypes()) { permissions.add(roleType.getName()); } } return permissions; } public pointcut accessToControlledMethods() : execution(@AccessControlled * net.sourceforge.fenixedu..*.*(..)); }