protected IAuthorizationPrincipal getUserPrincipal(final String userName) { final IEntity user = GroupService.getEntity(userName, IPerson.class); if (user == null) { return null; } final AuthorizationServiceFacade authService = AuthorizationServiceFacade.instance(); return authService.newPrincipal(user); } }
private IAuthorizationPrincipal getUserPrincipal(final String userName) { final IEntity user = GroupService.getEntity(userName, IPerson.class); if (user == null) { return null; } final AuthorizationServiceFacade authService = AuthorizationServiceFacade.instance(); return authService.newPrincipal(user); }
protected IAuthorizationPrincipal getUserPrincipal(final String userName) { final IEntity user = GroupService.getEntity(userName, IPerson.class); if (user == null) { return null; } final AuthorizationServiceFacade authService = AuthorizationServiceFacade.instance(); return authService.newPrincipal(user); } }
/** * Get the authoriztaion principal matching the supplied IPerson. * * @param person * @return */ protected IAuthorizationPrincipal getPrincipalForUser(final IPerson person) { final EntityIdentifier ei = person.getEntityIdentifier(); return AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType()); }
/** * Get the authorization principal matching the supplied IPerson. * * @param person * @return */ protected IAuthorizationPrincipal getPrincipalForUser(final IPerson person) { final EntityIdentifier ei = person.getEntityIdentifier(); return AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType()); } }
private boolean hasPermission(IPerson person, String permission, String target) { EntityIdentifier ei = person.getEntityIdentifier(); IAuthorizationPrincipal ap = AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType()); return ap.hasPermission(IPermission.PORTAL_GROUPS, permission, target); }
public boolean canDeleteGroup(IPerson currentUser, String target) { EntityIdentifier ei = currentUser.getEntityIdentifier(); IAuthorizationPrincipal ap = AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType()); return (ap.hasPermission( IPermission.PORTAL_GROUPS, IPermission.DELETE_GROUP_ACTIVITY, target)); }
public boolean canCreateMemberGroup(IPerson currentUser, String target) { EntityIdentifier ei = currentUser.getEntityIdentifier(); IAuthorizationPrincipal ap = AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType()); return (ap.hasPermission( IPermission.PORTAL_GROUPS, IPermission.CREATE_GROUP_ACTIVITY, target)); }
@Override public boolean canEditOwner(IPerson currentUser, String owner) { EntityIdentifier ei = currentUser.getEntityIdentifier(); IAuthorizationPrincipal ap = AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType()); return (ap.hasPermission( IPermission.PORTAL_PERMISSIONS, IPermission.EDIT_PERMISSIONS_ACTIVITY, IPermission.ALL_TARGET)); }
@Override public boolean canEditActivity(IPerson currentUser, String activity) { EntityIdentifier ei = currentUser.getEntityIdentifier(); IAuthorizationPrincipal ap = AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType()); return (ap.hasPermission( IPermission.PORTAL_PERMISSIONS, IPermission.EDIT_PERMISSIONS_ACTIVITY, IPermission.ALL_TARGET)); }
private IAuthorizationPrincipal getAuthorizationPrincipal(HttpServletRequest req) { IPerson user = personManager.getPerson(req); EntityIdentifier ei = user.getEntityIdentifier(); IAuthorizationPrincipal rslt = AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType()); return rslt; }
@Override public IAuthorizationPrincipal getCurrentPrincipal(final ExternalContext externalContext) { final IPerson person = getCurrentPerson(externalContext); final EntityIdentifier ei = person.getEntityIdentifier(); return AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType()); }
@Override public boolean canViewOwner(IPerson currentUser, String owner) { EntityIdentifier ei = currentUser.getEntityIdentifier(); IAuthorizationPrincipal ap = AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType()); return (ap.hasPermission( IPermission.PORTAL_PERMISSIONS, IPermission.VIEW_PERMISSIONS_ACTIVITY, IPermission.ALL_TARGET)); }
@Override public boolean canViewActivity(IPerson currentUser, String activity) { EntityIdentifier ei = currentUser.getEntityIdentifier(); IAuthorizationPrincipal ap = AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType()); return (ap.hasPermission( IPermission.PORTAL_PERMISSIONS, IPermission.VIEW_PERMISSIONS_ACTIVITY, IPermission.ALL_TARGET)); }
public boolean canEditGroup(IPerson currentUser, String target) { EntityIdentifier ei = currentUser.getEntityIdentifier(); IAuthorizationPrincipal ap = AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType()); return (ap.hasPermission( IPermission.PORTAL_GROUPS, IPermission.EDIT_GROUP_ACTIVITY, target)); }
public boolean canViewGroup(IPerson currentUser, String target) { EntityIdentifier ei = currentUser.getEntityIdentifier(); IAuthorizationPrincipal ap = AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType()); return (ap.hasPermission( IPermission.PORTAL_GROUPS, IPermission.VIEW_GROUP_ACTIVITY, target)); }
private boolean hasPermission(IPerson person, String permission, String target) { EntityIdentifier ei = person.getEntityIdentifier(); IAuthorizationPrincipal ap = AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType()); return ap.hasPermission(IPermission.PORTAL_GROUPS, permission, target); }
@Override public boolean canEditPermission(IPerson currentUser, String target) { EntityIdentifier ei = currentUser.getEntityIdentifier(); IAuthorizationPrincipal ap = AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType()); return (ap.hasPermission( IPermission.PORTAL_PERMISSIONS, IPermission.EDIT_PERMISSIONS_ACTIVITY, IPermission.ALL_TARGET)); }
@Override public boolean canViewPermission(IPerson currentUser, String target) { EntityIdentifier ei = currentUser.getEntityIdentifier(); IAuthorizationPrincipal ap = AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType()); return (ap.hasPermission( IPermission.PORTAL_PERMISSIONS, IPermission.VIEW_PERMISSIONS_ACTIVITY, IPermission.ALL_TARGET)); }
public boolean canDeleteUser(IPerson currentUser, String target) { // first check to see if this is a local user if (!isLocalAccount(target)) { return false; } EntityIdentifier ei = currentUser.getEntityIdentifier(); IAuthorizationPrincipal ap = AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType()); // TODO create new user editing permission return (ap.hasPermission("UP_USERS", "DELETE_USER", target)); }