Package org.apache.jetspeed.security

Examples of org.apache.jetspeed.security.PortletPermission

@author David Le Strat

        try
        {
            // TODO: it may be better to check the PagePermission for the outer
            // most
            // fragment (i.e. the PSML page)
            AccessController.checkPermission(new PortletPermission(resource, action));
        }
        catch (AccessControlException e)
        {
            return false;
        }
View Full Code Here


    else if (type.equals(TYPE_FRAGMENT))
      newPermission = new FragmentPermission(this.resource,this.actions);
      else if (type.equals(TYPE_PAGE))
        newPermission = new PagePermission(this.resource,this.actions);
        else if (type.equals(TYPE_PORTAL))
          newPermission = new PortletPermission(this.resource,this.actions);
          else return null;
      return newPermission;
    }
    catch (Exception e)
    {
View Full Code Here

            {
                String roleName = (String)roles.next();
                Role userRole = roleManager.getRole(roleName);
                if (userRole != null)
                {
                    Permission permission = new PortletPermission(paName + "::*", "view, edit");
                    if (!permissionManager.permissionExists(permission))
                    {
                        permissionManager.addPermission(permission);
                        permissionManager.grantPermission(userRole.getPrincipal(), permission);
                    }                   
View Full Code Here

            {
                String roleName = (String)roles.next();
                Role userRole = roleManager.getRole(roleName);
                if (userRole != null)
                {
                    Permission permission = new PortletPermission(paName + "::*", "view, edit");
                    if (permissionManager.permissionExists(permission))
                    {
                        permissionManager.removePermission(permission);
                    }                   
                   
View Full Code Here

            {
                String roleName = (String)roles.next();
                Role userRole = roleManager.getRole(roleName);
                if (userRole != null)
                {
                    Permission permission = new PortletPermission(paName + "::*", "view, edit");
                    if (!permissionManager.permissionExists(permission))
                    {
                        permissionManager.addPermission(permission);
                        permissionManager.grantPermission(userRole.getPrincipal(), permission);
                    }                   
View Full Code Here

            {
                String roleName = (String)roles.next();
                Role userRole = roleManager.getRole(roleName);
                if (userRole != null)
                {
                    Permission permission = new PortletPermission(paName + "::*", "view, edit");
                    if (permissionManager.permissionExists(permission))
                    {
                        permissionManager.removePermission(permission);
                    }                   
                   
View Full Code Here

    else if (type.equals(TYPE_FRAGMENT))
      newPermission = new FragmentPermission(this.resource,this.actions);
      else if (type.equals(TYPE_PAGE))
        newPermission = new PagePermission(this.resource,this.actions);
        else if (type.equals(TYPE_PORTAL))
          newPermission = new PortletPermission(this.resource,this.actions);
          else return null;
      return newPermission;
    }
    catch (Exception e)
    {
View Full Code Here

            {
                String roleName = (String)roles.next();
                Role userRole = roleManager.getRole(roleName);
                if (userRole != null)
                {
                    Permission permission = new PortletPermission(paName + "::*", "view, edit");
                    if (!permissionManager.permissionExists(permission))
                    {
                        permissionManager.addPermission(permission);
                        permissionManager.grantPermission(userRole.getPrincipal(), permission);
                    }                   
View Full Code Here

            {
                String roleName = (String)roles.next();
                Role userRole = roleManager.getRole(roleName);
                if (userRole != null)
                {
                    Permission permission = new PortletPermission(paName + "::*", "view, edit");
                    if (permissionManager.permissionExists(permission))
                    {
                        permissionManager.removePermission(permission);
                    }                   
                   
View Full Code Here

        // The user should still exist.
        assertTrue(ums.userExists("mappedroleuser"));
        // The group should still exist.
        assertTrue(gms.groupExists("mappedgroup"));
        // The permission should still exist.
        assertTrue(pms.permissionExists(new PortletPermission("myportlet", "view")));
        // The user-role mapping should be gone.
        assertFalse(rms.isUserInRole("mappedroleuser", "mappedrole"));
        // The group-role mapping should be gone.
        assertFalse(rms.isGroupInRole("mappedgroup", "mappedroleuser"));
        // The permission-role mapping should be gone.
        Permissions perms = pms.getPermissions(new RolePrincipalImpl("mappedrole"));
        assertFalse(perms.implies(new PortletPermission("myportlet", "view")));
       
        destroyMappedRole();
    }
View Full Code Here

TOP

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

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.