Package org.jasig.portal.services

Examples of org.jasig.portal.services.AuthorizationService


                categoryGroup.addMember(portletDefEntity);
                categoryGroup.updateMembers();
            }
   
            // Set groups
            final AuthorizationService authService = AuthorizationService.instance();
            final String target = PermissionHelper.permissionTargetIdForPortletDefinition(definition);
   
            final IUpdatingPermissionManager upm = authService.newUpdatingPermissionManager(FRAMEWORK_OWNER);
            final List<IPermission> permissions = new ArrayList<IPermission>(groupMembers.size());
            for (final IGroupMember member : groupMembers) {
                final IAuthorizationPrincipal authPrincipal = authService.newPrincipal(member);
                final IPermission permission = upm.newPermission(authPrincipal);
                permission.setType(GRANT_PERMISSION_TYPE);
                permission.setActivity(SUBSCRIBER_ACTIVITY);
                permission.setTarget(target);
                permissions.add(permission);
View Full Code Here


            group.removeMember(channelDefEntity);
            group.update();
        }

        // remove permissions
        AuthorizationService authService = AuthorizationService.instance();
        String target = PermissionHelper.permissionTargetIdForPortletDefinition(portletDefinition);
        IUpdatingPermissionManager upm = authService.newUpdatingPermissionManager(FRAMEWORK_OWNER);
        IPermission[] oldPermissions = upm.getPermissions(SUBSCRIBER_ACTIVITY, target);
        upm.removePermissions(oldPermissions);

        // delete the channel
        portletDefinitionDao.deletePortletDefinition(portletDef);
View Full Code Here

        
        
        final List<String> groupList = rep.getGroups();
        final List<String> userList = rep.getUsers();
       
        final AuthorizationService authService = org.jasig.portal.services.AuthorizationService.instance();
        final IPermissionManager pm = authService.newPermissionManager("UP_PORTLET_SUBSCRIBE");
        final String portletTargetId = PermissionHelper.permissionTargetIdForPortletDefinition(def);
        final IAuthorizationPrincipal[] principals = pm.getAuthorizedPrincipals("SUBSCRIBE", portletTargetId);
        
        for (IAuthorizationPrincipal principal : principals) {
            IGroupMember member = authService.getGroupMember(principal);
            if (member.isGroup()) {
                final EntityNameFinderService entityNameFinderService = EntityNameFinderService.instance();
                final IEntityNameFinder nameFinder = entityNameFinderService.getNameFinder(member.getType());
                try {
                    groupList.add(nameFinder.getName(member.getKey()));
View Full Code Here

            member = GroupService.findGroup(a.getPrincipal().getId());
        } else {
            member = GroupService.getGroupMember(a.getPrincipal().getId(), entityEnum.getClazz());
        }

        AuthorizationService authService = AuthorizationService.instance();
        Iterator<?> it = GroupService.getCompositeGroupService().findContainingGroups(member);
        if (it.hasNext()) {
            // This member must be nested within its parent(s)...
            while (it.hasNext()) {
                IEntityGroup group = (IEntityGroup) it.next();

                EntityEnum beanType = EntityEnum.getEntityEnum(group.getEntityType(), true);

                JsonEntityBean bean = new JsonEntityBean(group, beanType);
                Assignment parent = null;
                for (Assignment root : hierarchy) {
                    parent = root.findDecendentOrSelfIfExists(bean);
                    if (parent != null) {
                        // We found one...
                        parent.addChild(a);
                        break;
                    }
                }
                if (parent == null) {
                    // 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);
                }
View Full Code Here

        } else {
            entityType = jsonType.getClazz();
        }
       
        // construct an authorization principal for this JsonEntityBean
        AuthorizationService authService = AuthorizationService.instance();
        IAuthorizationPrincipal p = authService.newPrincipal(entity.getId(), entityType);
        return p;
    }
View Full Code Here

            ilfRoot.setIdAttribute(Constants.ATT_ID, true);

        // build the auth principal for determining if pushed channels can be
        // used by this user
        EntityIdentifier ei = person.getEntityIdentifier();
        AuthorizationService authS = AuthorizationService.instance();
        IAuthorizationPrincipal ap = authS.newPrincipal(ei.getKey(),
                ei.getType());

        // now merge fragments one at a time into ILF document
       
        for (final Document document : sequence) {
View Full Code Here

        final IEntity user = GroupService.getEntity(userName, IPerson.class);
        if (user == null) {
            return null;
        }
       
        final AuthorizationService authService = AuthorizationService.instance();
        return authService.newPrincipal(user);
    }
View Full Code Here

        if (portletMode != null) {
            if (IPortletRenderer.CONFIG.equals(portletMode)) {
                final IPerson person = this.personManager.getPerson(httpServletRequest);
               
                final EntityIdentifier ei = person.getEntityIdentifier();
                final AuthorizationService authorizationService = AuthorizationService.instance();
                final IAuthorizationPrincipal ap = authorizationService.newPrincipal(ei.getKey(), ei.getType());
               
                final IPortletEntity portletEntity = portletWindow.getPortletEntity();
                final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
               
                if (!ap.canConfigure(portletDefinition.getPortletDefinitionId().getStringId())) {
View Full Code Here

        final IEntity user = GroupService.getEntity(userName, IPerson.class);
        if (user == null) {
            return null;
        }
       
        final AuthorizationService authService = AuthorizationService.instance();
        return authService.newPrincipal(user);
    }
View Full Code Here

       * authenticated user
       */
     
        IUserInstance userInstance = userInstanceManager.getUserInstance(request);
        IPerson person = userInstance.getPerson();
        AuthorizationService authService = AuthorizationService.instance();
        IAuthorizationPrincipal principal = authService.newPrincipal(person.getUserName(), IPerson.class);
     
        /**
         * Build a collection of owner IDs for the fragments to which the
         * authenticated user is subscribed
         */
 
View Full Code Here

TOP

Related Classes of org.jasig.portal.services.AuthorizationService

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.