Search in sources :

Example 21 with EntityIdentifier

use of org.apereo.portal.EntityIdentifier in project uPortal by Jasig.

the class PermissionAdministrationHelper method canViewActivity.

public boolean canViewActivity(IPerson currentUser, String activity) {
    EntityIdentifier ei = currentUser.getEntityIdentifier();
    IAuthorizationPrincipal ap = AuthorizationService.instance().newPrincipal(ei.getKey(), ei.getType());
    return (ap.hasPermission(IPermission.PORTAL_PERMISSIONS, IPermission.VIEW_PERMISSIONS_ACTIVITY, IPermission.ALL_TARGET));
}
Also used : IAuthorizationPrincipal(org.apereo.portal.security.IAuthorizationPrincipal) EntityIdentifier(org.apereo.portal.EntityIdentifier)

Example 22 with EntityIdentifier

use of org.apereo.portal.EntityIdentifier in project uPortal by Jasig.

the class PermissionAdministrationHelper method canEditPermission.

/* (non-Javadoc)
     * @see org.apereo.portal.portlets.permissionsadmin.IPermissionAdministrationHelper#canEditPermission(org.apereo.portal.security.IPerson, java.lang.String)
     */
public boolean canEditPermission(IPerson currentUser, String target) {
    EntityIdentifier ei = currentUser.getEntityIdentifier();
    IAuthorizationPrincipal ap = AuthorizationService.instance().newPrincipal(ei.getKey(), ei.getType());
    return (ap.hasPermission(IPermission.PORTAL_PERMISSIONS, IPermission.EDIT_PERMISSIONS_ACTIVITY, IPermission.ALL_TARGET));
}
Also used : IAuthorizationPrincipal(org.apereo.portal.security.IAuthorizationPrincipal) EntityIdentifier(org.apereo.portal.EntityIdentifier)

Example 23 with EntityIdentifier

use of org.apereo.portal.EntityIdentifier in project uPortal by Jasig.

the class PermissionAdministrationHelper method canViewPermission.

/* (non-Javadoc)
     * @see org.apereo.portal.portlets.permissionsadmin.IPermissionAdministrationHelper#canViewPermission(org.apereo.portal.security.IPerson, java.lang.String)
     */
public boolean canViewPermission(IPerson currentUser, String target) {
    EntityIdentifier ei = currentUser.getEntityIdentifier();
    IAuthorizationPrincipal ap = AuthorizationService.instance().newPrincipal(ei.getKey(), ei.getType());
    return (ap.hasPermission(IPermission.PORTAL_PERMISSIONS, IPermission.VIEW_PERMISSIONS_ACTIVITY, IPermission.ALL_TARGET));
}
Also used : IAuthorizationPrincipal(org.apereo.portal.security.IAuthorizationPrincipal) EntityIdentifier(org.apereo.portal.EntityIdentifier)

Example 24 with EntityIdentifier

use of org.apereo.portal.EntityIdentifier in project uPortal by Jasig.

the class PermissionAdministrationHelper method canViewOwner.

public boolean canViewOwner(IPerson currentUser, String owner) {
    EntityIdentifier ei = currentUser.getEntityIdentifier();
    IAuthorizationPrincipal ap = AuthorizationService.instance().newPrincipal(ei.getKey(), ei.getType());
    return (ap.hasPermission(IPermission.PORTAL_PERMISSIONS, IPermission.VIEW_PERMISSIONS_ACTIVITY, IPermission.ALL_TARGET));
}
Also used : IAuthorizationPrincipal(org.apereo.portal.security.IAuthorizationPrincipal) EntityIdentifier(org.apereo.portal.EntityIdentifier)

Example 25 with EntityIdentifier

use of org.apereo.portal.EntityIdentifier in project uPortal by Jasig.

the class PermissionAdministrationHelper method canEditActivity.

public boolean canEditActivity(IPerson currentUser, String activity) {
    EntityIdentifier ei = currentUser.getEntityIdentifier();
    IAuthorizationPrincipal ap = AuthorizationService.instance().newPrincipal(ei.getKey(), ei.getType());
    return (ap.hasPermission(IPermission.PORTAL_PERMISSIONS, IPermission.EDIT_PERMISSIONS_ACTIVITY, IPermission.ALL_TARGET));
}
Also used : IAuthorizationPrincipal(org.apereo.portal.security.IAuthorizationPrincipal) EntityIdentifier(org.apereo.portal.EntityIdentifier)

Aggregations

EntityIdentifier (org.apereo.portal.EntityIdentifier)79 IAuthorizationPrincipal (org.apereo.portal.security.IAuthorizationPrincipal)31 HashSet (java.util.HashSet)20 IPerson (org.apereo.portal.security.IPerson)17 ArrayList (java.util.ArrayList)15 IEntityGroup (org.apereo.portal.groups.IEntityGroup)13 IGroupMember (org.apereo.portal.groups.IGroupMember)12 IPortletDefinition (org.apereo.portal.portlet.om.IPortletDefinition)12 Set (java.util.Set)9 GroupsException (org.apereo.portal.groups.GroupsException)9 Iterator (java.util.Iterator)7 Element (net.sf.ehcache.Element)6 PortletCategory (org.apereo.portal.portlet.om.PortletCategory)6 HashMap (java.util.HashMap)4 List (java.util.List)4 LinkedHashSet (java.util.LinkedHashSet)3 LinkedList (java.util.LinkedList)2 Locale (java.util.Locale)2 Map (java.util.Map)2 SortedSet (java.util.SortedSet)2