Package org.apache.jetspeed.security

Examples of org.apache.jetspeed.security.JetspeedPermission


            List pages = new LinkedList();
            List portlets = new LinkedList();
            Iterator<JetspeedPermission> all = pm.getPermissions().iterator();
            while (all.hasNext())
            {
                JetspeedPermission permission = all.next();               
                if (permission.getType().equals(PermissionFactory.FOLDER_PERMISSION))
                {
                    folders.add(new PermissionData(permission));                   
                }
                else if (permission.getType().equals(PermissionFactory.PAGE_PERMISSION))
                {
                    pages.add(new PermissionData(permission));
                }
                else if (permission.getType().equals(PermissionFactory.PORTLET_PERMISSION))
                {
                    portlets.add(new PermissionData(permission));
                }               
            }
            folderPermissions = folders.iterator();
View Full Code Here


            for (String roleName : permissionRoles)
            {
                Role userRole = roleManager.getRole(roleName);
                if (userRole != null)
                {
                    JetspeedPermission permission = permissionManager.newPermission(permissionManager.PORTLET_PERMISSION, paName + "::*", "view, edit");
                    if (!permissionManager.permissionExists(permission))
                    {
                        permissionManager.addPermission(permission);
                        permissionManager.grantPermission(permission, userRole);
                    }                   
View Full Code Here

            for (String roleName : permissionRoles)
            {
                Role userRole = roleManager.getRole(roleName);
                if (userRole != null)
                {
                    JetspeedPermission permission = permissionManager.newPermission(permissionManager.PORTLET_PERMISSION, paName + "::*", "view, edit");
                    if (permissionManager.permissionExists(permission))
                    {
                        permissionManager.removePermission(permission);
                    }                   
                   
View Full Code Here

            for (String roleName : permissionRoles)
            {
                Role userRole = roleManager.getRole(roleName);
                if (userRole != null)
                {
                    JetspeedPermission permission = permissionManager.newPermission(permissionManager.PORTLET_PERMISSION, paName + "::*", "view, edit");
                    if (!permissionManager.permissionExists(permission))
                    {
                        permissionManager.addPermission(permission);
                        permissionManager.grantPermission(permission, userRole);
                    }                   
View Full Code Here

            for (String roleName : permissionRoles)
            {
                Role userRole = roleManager.getRole(roleName);
                if (userRole != null)
                {
                    JetspeedPermission permission = permissionManager.newPermission(permissionManager.PORTLET_PERMISSION, paName + "::*", "view, edit");
                    if (permissionManager.permissionExists(permission))
                    {
                        permissionManager.removePermission(permission);
                    }                   
                   
View Full Code Here

        {
            // classify policy query for local test case; this implementation
            // is not optimized: multiple protection domains exist on the
            // call stack, so this method will be invoked 2-3 times for each
            // access check with the identical principals and permission
            JetspeedPermission j2p = permission instanceof JetspeedPermission ? (JetspeedPermission)permission : null;
            boolean testPermission = j2p != null && (j2p.getType().equals("folder")||j2p.getType().equals("page")||j2p.getType().equals("fragment"));
            Principal[] principals = domain.getPrincipals();
            if ((principals != null) && (principals.length > 0) && (testPermission))
            {
                // check permission using principals if available
                Permissions permissions = new Permissions();
View Full Code Here

                throw new AJAXException("Missing 'resource' parameter");
            String actions = getActionParameter(requestContext, "actions");
            if (actions == null)
                throw new AJAXException("Missing 'actions' parameter");
           
            JetspeedPermission permission = pm.newPermission(type, resource, actions);           
            if (pm.permissionExists(permission))
            {
                throw new AJAXException("Permission " + resource + " already exists");
            }  
           
View Full Code Here

            if (oldActions == null)
            {
                // assume no change
                oldActions = actions;
            }
            JetspeedPermission permission = pm.newPermission(type, resource, actions);
            if (!oldActions.equals(actions))
            {
                pm.updatePermission(permission);
            }  
//            else
View Full Code Here

            if (resource == null)
                throw new AJAXException("Missing 'resource' parameter");
            String actions = getActionParameter(requestContext, "actions");
            if (actions == null)
                throw new AJAXException("Missing 'actions' parameter");           
            JetspeedPermission permission = pm.newPermission(type, resource, actions);           
            if (pm.permissionExists(permission))
            {
                pm.removePermission(permission);
                return 1;
            }
View Full Code Here

            throw new SerializerException(SerializerException.GET_EXISTING_OBJECTS.create(new String[] { "Permissions",
                    e.getMessage() }));
        }
        for (JSPermission jsPermission : permissionList)
        {
            JetspeedPermission perm = null;
            if (jsPermission.getType().equals(JSPermission.TYPE_PORTAL))
            {
                perm = pm.newPermission(PermissionFactory.PORTLET_PERMISSION, jsPermission.getResource(), jsPermission.getActions());
            }
            else
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.security.JetspeedPermission

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.