Package com.adito.policyframework

Examples of com.adito.policyframework.AccessRight


        return getPolicyService().createPolicy(name, description, type, realm.getRealmID());
    }
   
    protected AccessRights createAllAccessRights(String delegationClass) throws Exception {
        List<AccessRight> accessRights = new ArrayList<AccessRight>();
        accessRights.add(new AccessRight(getResourceType(), PolicyConstants.PERM_CREATE_EDIT_AND_ASSIGN));
        accessRights.add(new AccessRight(getResourceType(), PolicyConstants.PERM_DELETE));
        return createAccessRights(delegationClass, accessRights);
    }
View Full Code Here


        accessRights.add(new AccessRight(getResourceType(), PolicyConstants.PERM_DELETE));
        return createAccessRights(delegationClass, accessRights);
    }

    protected AccessRights createCreateEditAssignAccessRights(String delegationClass) throws Exception {
        List<AccessRight> accessRights = Collections.singletonList(new AccessRight(getResourceType(), PolicyConstants.PERM_CREATE_EDIT_AND_ASSIGN));
        return createAccessRights(delegationClass, accessRights);
    }
View Full Code Here

        List<AccessRight> accessRights = Collections.singletonList(new AccessRight(getResourceType(), PolicyConstants.PERM_CREATE_EDIT_AND_ASSIGN));
        return createAccessRights(delegationClass, accessRights);
    }
   
    protected AccessRights createEditAssignAccessRights(String delegationClass) throws Exception{
        List<AccessRight> accessRights = Collections.singletonList(new AccessRight(getResourceType(), PolicyConstants.PERM_EDIT_AND_ASSIGN));
        return createAccessRights(delegationClass, accessRights);
    }
View Full Code Here

        List<AccessRight> accessRights = Collections.singletonList(new AccessRight(getResourceType(), PolicyConstants.PERM_EDIT_AND_ASSIGN));
        return createAccessRights(delegationClass, accessRights);
    }
   
    protected AccessRights createAssignAccessRights(String delegationClass) throws Exception{
        List<AccessRight> accessRights = Collections.singletonList(new AccessRight(getResourceType(), PolicyConstants.PERM_ASSIGN));
        return createAccessRights(delegationClass, accessRights);
    }
View Full Code Here

        List<AccessRight> accessRights = Collections.singletonList(new AccessRight(getResourceType(), PolicyConstants.PERM_ASSIGN));
        return createAccessRights(delegationClass, accessRights);
    }
   
    protected AccessRights createDeleteAccessRights(String delegationClass) throws Exception{
        List<AccessRight> accessRights = Collections.singletonList(new AccessRight(getResourceType(), PolicyConstants.PERM_DELETE));
        return createAccessRights(delegationClass, accessRights);
    }
View Full Code Here

           List permissionsList = accessRights.getAccessRights();
            if (permissionsList != null) {
                int j =0;
                for (Iterator i = permissionsList.iterator(); i.hasNext();) {
                    j++;
                    AccessRight permission = (AccessRight)i.next();

                    MessageResources mrPermission = CoreUtil.getMessageResources(request.getSession(), permission.getPermission().getBundle());
                    String permissionName = mrPermission.getMessage("permission."+permission.getPermission().getId()+".title").trim();

                    MessageResources mrResourceType = CoreUtil.getMessageResources(request.getSession(), permission.getResourceType().getBundle());
                    String resourceTypeName = mrResourceType.getMessage("resourceType."+permission.getResourceType().getResourceTypeId()+".title").trim();
                    coreEvent.addAttribute(CoreAttributeConstants.EVENT_ATTR_TYPE_PERMISSION + Integer.toString(j), permissionName + " " + resourceTypeName);
                }
            }
            CoreServlet.getServlet().fireCoreEvent(coreEvent);
           
View Full Code Here

        setResourceService(new ResourceServiceAdapter<AccessRights>(resourceType));
    }

    @Override
    protected AccessRights getDefaultResource(int selectedRealmId) {
        AccessRight accessRight = new AccessRight(resourceType, new Permission(1, "policyFramework"));
        List<AccessRight> accessRightsList = Collections.singletonList(accessRight);
        return new DefaultAccessRights(selectedRealmId, -1, "MyNewAccessRight", "A test access right.", accessRightsList,
                        PolicyConstants.PERSONAL_CLASS, Calendar.getInstance(), Calendar.getInstance());
    }
View Full Code Here

   
    @Override
    protected void updateResourceProperties(AbstractResourceForm<AccessRights> resourceForm) throws Exception {
        AccessRightsForm accessRightsForm = (AccessRightsForm) resourceForm;
        AccessRights resource = accessRightsForm.getResource();
        resource.addAccessRight(new AccessRight(resourceType, new Permission(PolicyConstants.PERM_EDIT_AND_ASSIGN_ID, "policyframework")));
        resource.addAccessRight(new AccessRight(resourceType, new Permission(PolicyConstants.PERM_DELETE_ID, "policyframework")));
    }
View Full Code Here

    }

    protected void updateInvalidResourceProperties(AbstractResourceForm<AccessRights> resourceForm) throws Exception {
        AccessRightsForm accessRightsForm = (AccessRightsForm) resourceForm;
        AccessRights resource = accessRightsForm.getResource();
        resource.addAccessRight(new AccessRight(resourceType, new Permission(PolicyConstants.PERM_EDIT_ID, "policyframework")));
    }
View Full Code Here

        assertEquals("Permissions are correct", original.getAccessRights(), updated.getAccessRights());
    }

    @Override
    protected AccessRights getDefaultResource(int selectedRealmId) {
        AccessRight accessRight = new AccessRight(resourceType, new Permission(PolicyConstants.PERM_CREATE_AND_ASSIGN_ID, "policyframework"));
        List<AccessRight> accessRightsList = Collections.singletonList(accessRight);
        return new DefaultAccessRights(selectedRealmId, -1, "MyNewAccessRight", "A test access right.", accessRightsList,
                        PolicyConstants.PERSONAL_CLASS, Calendar.getInstance(), Calendar.getInstance());
    }
View Full Code Here

TOP

Related Classes of com.adito.policyframework.AccessRight

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.