Package org.jasig.portal.security

Examples of org.jasig.portal.security.IAuthorizationPrincipal


throws AuthorizationException
{
    Set principals = new HashSet();
    for ( int i=0; i<permissions.length; i++ )
    {
        IAuthorizationPrincipal principal = getPrincipal(permissions[i]);
        principals.add(principal);
    }
    return ((IAuthorizationPrincipal[])principals.toArray(new IAuthorizationPrincipal[principals.size()]));
}
View Full Code Here


   
    if (this.principalCache.containsKey(principalKey)) {
        return (IAuthorizationPrincipal) this.principalCache.get(principalKey);
    }
   
    final IAuthorizationPrincipal principal = primNewPrincipal(key, type);
    this.principalCache.put(principalKey, principal);
   
    return principal;
}
View Full Code Here

    try
    {
        Iterator i = service.getGroupMember(principal).getAllContainingGroups();
        while ( i.hasNext() && ! hasPermission )
        {
            IAuthorizationPrincipal prn = service.newPrincipal( (IGroupMember) i.next() );
            hasPermission = primDoesPrincipalHavePermission(prn, owner, activity, target, service);
         }
    }
    catch ( GroupsException ge )
        { throw new AuthorizationException(ge); }
View Full Code Here

        JsonEntityBean bean = groupListHelper.getEntityForPrincipal(principal);

        if (bean != null) {
           
            IAuthorizationPrincipal p = groupListHelper.getPrincipalForEntity(bean);
           
            IPermission[] directPermissions = permissionStore.select(owner, p.getPrincipalString(), activity, target, null);
            this.authorizationService.removePermissions(directPermissions);
           
            assignment = assignment.toUpperCase();
            if (assignment.equals(Assignment.Type.GRANT.toString()) || assignment.equals(Assignment.Type.DENY.toString())) {
                IPermission permission = new PermissionImpl(owner);
View Full Code Here

           
            JsonEntityBean bean = groupListHelper.getEntityForPrincipal(principal);

            if (bean != null) {
               
                IAuthorizationPrincipal p = groupListHelper.getPrincipalForEntity(bean);
               
                // first get the permissions explicitly set for this principal
                Assignment.Type type = getAssignmentType(p, owner, activity, target);
                flatAssignmentsList.add(new Assignment(principal, bean, type));
View Full Code Here

                    // We weren't able to integrate this node into the existing
                    // hierarchy;  we have to dig deeper, until we either (1)
                    // find a match, or (2) reach a root;  type is INHERIT,
                    // unless (by chance) there's something specified in an
                    // entry on grantOrDenyMap.
                    IAuthorizationPrincipal principal = authService.newPrincipal(group);
                    Assignment.Type assignmentType = getAssignmentType(principal, owner, activity, target);
                    parent = new Assignment(principal.getPrincipalString(), bean, assignmentType);
                    parent.addChild(a);
                    placeInHierarchy(parent, hierarchy, owner, activity, target);
                }
            }
        } else {
View Full Code Here

   *
   * @return true if the userInstance argument has administrative privileges regarding viewing error details
   */
  protected boolean hasAdminPrivileges(IUserInstance userInstance) {
    EntityIdentifier ei = userInstance.getPerson().getEntityIdentifier();
      IAuthorizationPrincipal ap = AuthorizationService.instance().newPrincipal(ei.getKey(), ei.getType());
      return ap.hasPermission(ERROR_OWNER, ERROR_ACTIVITY, ERROR_TARGET);
  }
View Full Code Here

        return true;
    if (obj == null)
        return false;
    if (!(obj instanceof IAuthorizationPrincipal))
        return false;
    IAuthorizationPrincipal other = (IAuthorizationPrincipal) obj;
    if (key == null) {
        if (other.getKey() != null)
            return false;
    }
    else if (!key.equals(other.getKey()))
        return false;
    if (type == null) {
        if (other.getType() != null)
            return false;
    }
    else if (!type.equals(other.getType()))
        return false;
    return true;
}
View Full Code Here

            }
           
            if (!portletDefinitions.isEmpty()) {
              final IPerson user = userInstance.getPerson();
            final EntityIdentifier ei = user.getEntityIdentifier();
            final IAuthorizationPrincipal ap = AuthorizationService.instance().newPrincipal(ei.getKey(), ei.getType());
             
              //If the event is global there might still be portlet definitions that need targeting
              for (final IPortletDefinition portletDefinition : portletDefinitions) {
                final IPortletDefinitionId portletDefinitionId = portletDefinition.getPortletDefinitionId();
                //Check if the user can render the portlet definition before doing event tests
                if (ap.canRender(portletDefinitionId.getStringId())) {
                  if (this.supportsEvent(event, portletDefinitionId)) {
                    this.logger.debug("{} supports event {}", portletDefinition, event);
                     
                      final IPortletEntity portletEntity = this.portletEntityRegistry.getOrCreateDefaultPortletEntity(request, portletDefinitionId);
                        final IPortletEntityId portletEntityId = portletEntity.getPortletEntityId();
View Full Code Here

            // STEP (2):  Is the person authenticated?
            final ISecurityContext securityContext = person.getSecurityContext();
            if (securityContext != null && securityContext.isAuthenticated()) {
              
                // STEP (3):  Does this user have SUBSCRIBE permission for permissionsAdminChannel?
                IAuthorizationPrincipal principal = authorizationService.newPrincipal((String) person.getAttribute(IPerson.USERNAME), IPerson.class);
               
                final IPortletDefinition permissionsAdminPortlet = portletDefinitionRegistry.getPortletDefinitionByFname(PERMISSIONS_ADMIN_PORTLET_FNAME);
                if (permissionsAdminPortlet == null) {
                    return false;
                }
View Full Code Here

TOP

Related Classes of org.jasig.portal.security.IAuthorizationPrincipal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.