package pt.iscte.ci.zas; import net.sourceforge.fenixedu.applicationTier.IUserView; import net.sourceforge.fenixedu.domain.Person; import net.sourceforge.fenixedu.domain.person.RoleType; import net.sourceforge.zas.aop.bridge.IAOPMetaData; public class PersonDecider extends FenixDefaultDecider { @Override public boolean internalHasAccess(IUserView subject, String protectedObjectAbstractAccessModes, IAOPMetaData aopMetaData) { final Person personInArgument = (Person) aopMetaData.getJoinPoint().getArgs()[0]; return subject.hasRoleType(RoleType.PERSON) && subject.getPerson() == personInArgument; } }