Examples of newPrincipal()


Examples of org.apache.jetspeed.security.JetspeedPrincipalManager.newPrincipal()

        boolean syncAll = false;
       
        if (principal == null)
        {
            // principal does not exist yet, create a new one using the principal manager
            principal = principalManager.newPrincipal(entity.getId(), true);
            principalManager.addPrincipal(principal, toAssociations);
            syncAll = true;
        }
        else if (!principal.isMapped())
        {
View Full Code Here

Examples of org.apache.jetspeed.security.JetspeedPrincipalManager.newPrincipal()

            Collection<Attribute> attrsToBeUpdated = new ArrayList<Attribute>();
            if (updatedPrincipal == null)
            {
                // principal does not exist yet, create it using the Jetspeed
                // principal manager
                updatedPrincipal = principalManager.newPrincipal(entity.getId(), true);
                try
                {
                    principalManager.addPrincipal(updatedPrincipal, null);
                    if (logger.isDebugEnabled()){
                        logger.debug("Adding principal "+updatedPrincipal.getName()+" of type "+updatedPrincipal.getType().getName()+" ...");
View Full Code Here

Examples of org.apache.jetspeed.security.JetspeedPrincipalManager.newPrincipal()

                    principalManager = this.principalManagerProvider.getManager(type);
                    JetspeedPrincipal principal = null;
                   
                    if (!(principalManager.principalExists(name)))
                    {
                        principal = principalManager.newPrincipal(name, jsPrincipal.isMapped());
                        JSSecurityAttributes jsSecAttrs = jsPrincipal.getSecurityAttributes();
                        if (jsSecAttrs != null)
                        {
                            for (JSNVPElement elem : jsSecAttrs.getValues())
                            {
View Full Code Here

Examples of org.apache.jetspeed.security.JetspeedPrincipalManager.newPrincipal()

        boolean syncAll = false;
       
        if (principal == null)
        {
            // principal does not exist yet, create a new one using the principal manager
            principal = principalManager.newPrincipal(entity.getId(), true);
            principalManager.addPrincipal(principal, toAssociations);
            syncAll = true;
        }
        else if (!principal.isMapped())
        {
View Full Code Here

Examples of org.apache.jetspeed.security.JetspeedPrincipalManager.newPrincipal()

                    principalManager = this.principalManagerProvider.getManager(type);
                    JetspeedPrincipal principal = null;
                   
                    if (!(principalManager.principalExists(name)))
                    {
                        principal = principalManager.newPrincipal(name, jsPrincipal.isMapped());
                        JSSecurityAttributes jsSecAttrs = jsPrincipal.getSecurityAttributes();
                        if (jsSecAttrs != null)
                        {
                            for (JSNVPElement elem : jsSecAttrs.getValues())
                            {
View Full Code Here

Examples of org.jasig.portal.security.IAuthorizationService.newPrincipal()

                // DistributedLayoutManager shall gracefully remove channels
                // that the user isn't authorized to render from folders of type
                // 'header' and 'footer'.
                IAuthorizationService authServ = AuthorizationImpl.singleton();
                IAuthorizationPrincipal principal = authServ.newPrincipal(owner.getUserName(), IPerson.class);
                NodeList nodes = userLayoutDocument.getElementsByTagName("folder");
                for (int i=0; i < nodes.getLength(); i++) {
                  Element fd = (Element) nodes.item(i);
                  String type = fd.getAttribute("type");
                  if (type != null && (type.equals("header") || type.equals("footer"))) {
View Full Code Here

Examples of org.jasig.portal.services.AuthorizationService.newPrincipal()

        this.ssTitle = "friendly";
        try {
            final AuthorizationService authService = AuthorizationService.instance();
            final IPerson person = userPreferencesManager.getPerson();
            final EntityIdentifier ei = person.getEntityIdentifier();
            final IAuthorizationPrincipal ap = authService.newPrincipal(ei.getKey(), ei.getType());
           
            if (ap.hasPermission(SupportedPermissions.OWNER, SupportedPermissions.VIEW_ACTIVITY, SupportedPermissions.DETAILS_TARGET)) {
                this.ssTitle = "detailed";
            }
        }
View Full Code Here

Examples of org.jasig.portal.services.AuthorizationService.newPrincipal()

            if (IPortletAdaptor.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 IPortletDefinition portletDefinition = this.portletEntityRegistry.getParentPortletDefinition(portletWindow.getPortletEntityId());
                final IChannelDefinition channelDefinition = portletDefinition.getChannelDefinition();
               
                if (!ap.canConfigure(channelDefinition.getId())) {
View Full Code Here

Examples of org.jasig.portal.services.AuthorizationService.newPrincipal()

      AuthorizationService authService = AuthorizationService.instance();
      String target = IPermission.CHANNEL_PREFIX + definition.getId();
      IUpdatingPermissionManager upm = authService.newUpdatingPermissionManager(FRAMEWORK_OWNER);
      IPermission[] permissions = new IPermission[groupMembers.length];
      for (int i = 0; i < groupMembers.length; i++) {
        IAuthorizationPrincipal authPrincipal = authService.newPrincipal(groupMembers[i]);
        permissions[i] = upm.newPermission(authPrincipal);
        permissions[i].setType(GRANT_PERMISSION_TYPE);
        permissions[i].setActivity(SUBSCRIBER_ACTIVITY);
        permissions[i].setTarget(target);
      }
View Full Code Here

Examples of org.jasig.portal.services.AuthorizationService.newPrincipal()

        if (user == null) {
            return null;
        }
       
        final AuthorizationService authService = AuthorizationService.instance();
        return authService.newPrincipal(user);
    }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.