Package org.apache.jetspeed.om.security

Examples of org.apache.jetspeed.om.security.Permission


        throws JetspeedSecurityException
    {
        try
        {
            Role role = JetspeedSecurity.getRole(roleName);
            Permission permission = this.getPermission(permissionName);

            Criteria criteria = new Criteria();
            criteria.add(TurbineRolePermissionPeer.ROLE_ID, role.getId());
            criteria.add(TurbineRolePermissionPeer.PERMISSION_ID, permission.getId());
            TurbineRolePermissionPeer.doInsert(criteria);
            if (cachingEnable)
            {
                JetspeedSecurityCache.addPermission(roleName,permission);
            }
View Full Code Here


        throws JetspeedSecurityException
    {
        try
        {
            Role role = JetspeedSecurity.getRole(roleName);
            Permission permission = this.getPermission(permissionName);

            Criteria criteria = new Criteria();
            criteria.add(TurbineRolePermissionPeer.ROLE_ID, role.getId());
            criteria.add(TurbineRolePermissionPeer.PERMISSION_ID, permission.getId());
            TurbineRolePermissionPeer.doDelete(criteria);
            if (cachingEnable)
            {
                JetspeedSecurityCache.removePermission(roleName, permissionName);
            }
View Full Code Here

            {
                return JetspeedSecurityCache.hasPermission(roleName, permissionName);
            }

            Role role = JetspeedSecurity.getRole(roleName);
            Permission permission = this.getPermission(permissionName);

            Criteria criteria = new Criteria();
            criteria.add(TurbineRolePermissionPeer.ROLE_ID, role.getId());
            criteria.add(TurbineRolePermissionPeer.PERMISSION_ID, permission.getId());
            permissions = TurbineRolePermissionPeer.doSelect(criteria);

        }
        catch(Exception e)
        {
View Full Code Here

        boolean sel = false;
        int ix = 0;
        selected.add(0, new Boolean(sel));
        while(master.hasNext())
        {
            Permission permission = (Permission) master.next();
            permissions.add(permission);
            sel = JetspeedSecurity.hasPermission(roleName, permission.getName());
            ix = ix + 1;
            selected.add(ix, new Boolean(sel));
        }
        selected.trimToSize();
        permissions.trimToSize();
View Full Code Here

                perms = new HashMap();

            for (int ix = 0; ix < rels.size(); ix++)
            {
                TurbineRolePermission rel = (TurbineRolePermission)rels.get(ix);
                Permission perm = rel.getTurbinePermission();
                perms.put(perm.getName(), perm);
            }
        }
        catch(Exception e)
        {
            logger.error( "Failed to retrieve permissions ", e );
View Full Code Here

            {
                throw new PermissionException("[" + permissionName + "] is a system permission and cannot be removed");
            }

            conn = Torque.getConnection();
            Permission permission = this.getPermission(permissionName);

            Criteria criteria = new Criteria();
            criteria.add(TurbinePermissionPeer.PERMISSION_NAME, permissionName);

            if(cascadeDelete)
            {
                // CASCADE to TURBINE_ROLE_PERMISSION
                Criteria critRolePerm = new Criteria();
                critRolePerm.add(TurbineRolePermissionPeer.PERMISSION_ID, permission.getId());
                TurbineRolePermissionPeer.doDelete(critRolePerm, conn);
            }
            TurbinePermissionPeer.doDelete(criteria, conn);
               
            conn.commit();
View Full Code Here

        throws JetspeedSecurityException
    {
        try
        {
            Role role = JetspeedSecurity.getRole(roleName);
            Permission permission = this.getPermission(permissionName);

            Criteria criteria = new Criteria();
            criteria.add(TurbineRolePermissionPeer.ROLE_ID, role.getId());
            criteria.add(TurbineRolePermissionPeer.PERMISSION_ID, permission.getId());
            TurbineRolePermissionPeer.doInsert(criteria);
            if (cachingEnable)
            {
                JetspeedSecurityCache.addPermission(roleName,permission);
            }
View Full Code Here

        throws JetspeedSecurityException
    {
        try
        {
            Role role = JetspeedSecurity.getRole(roleName);
            Permission permission = this.getPermission(permissionName);

            Criteria criteria = new Criteria();
            criteria.add(TurbineRolePermissionPeer.ROLE_ID, role.getId());
            criteria.add(TurbineRolePermissionPeer.PERMISSION_ID, permission.getId());
            TurbineRolePermissionPeer.doDelete(criteria);
            if (cachingEnable)
            {
                JetspeedSecurityCache.removePermission(roleName, permissionName);
            }
View Full Code Here

            {
                return JetspeedSecurityCache.hasPermission(roleName, permissionName);
            }

            Role role = JetspeedSecurity.getRole(roleName);
            Permission permission = this.getPermission(permissionName);

            Criteria criteria = new Criteria();
            criteria.add(TurbineRolePermissionPeer.ROLE_ID, role.getId());
            criteria.add(TurbineRolePermissionPeer.PERMISSION_ID, permission.getId());
            permissions = TurbineRolePermissionPeer.doSelect(criteria);

        }
        catch(Exception e)
        {
View Full Code Here

                Role role = (Role)roles.next();
                Map map = new HashMap();
                Iterator prms = JetspeedSecurity.getPermissions(role.getName());
                while (prms.hasNext())
                {
                    Permission perm = (Permission)prms.next();
                    map.put(perm.getName(), perm);
                }
                perms.put(role.getName(), map);
            }
        }
        catch (JetspeedSecurityException e)
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.security.Permission

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.