Package com.adito.boot

Examples of com.adito.boot.PropertyList


        T resource = createResource();
        getPolicyService().attachResourceToPolicy(resource, policy, 0, realm);
       
        getPolicyService().grantPolicyToPrincipal(policy, role);
        AccessRights accessRights = createCreateEditAssignAccessRights(getResourceType().getPermissionClass());
        PropertyList selectedPolicies = PropertyList.createFromArray(new int[] {policy.getResourceId()});
        PolicyDatabaseFactory.getInstance().attachResourceToPolicyList(accessRights, selectedPolicies, getSessionInfo());
       
        Permission[] permissions = new Permission[] {PolicyConstants.PERM_CREATE_EDIT_AND_ASSIGN};
        assertTrue("The permissions should be permitted.", getPolicyService().isPermitted(getResourceType(), permissions, user, false));
        permissions = new Permission[] {PolicyConstants.PERM_DELETE};
View Full Code Here


        T resource = createResource();
        getPolicyService().attachResourceToPolicy(resource, policy, 0, realm);
       
        getPolicyService().grantPolicyToPrincipal(policy, role);
        AccessRights accessRights = createEditAssignAccessRights(getResourceType().getPermissionClass());
        PropertyList selectedPolicies = PropertyList.createFromArray(new int[] {policy.getResourceId()});
        PolicyDatabaseFactory.getInstance().attachResourceToPolicyList(accessRights, selectedPolicies, getSessionInfo());
       
        Permission[] permissions = new Permission[] {PolicyConstants.PERM_EDIT_AND_ASSIGN};
        assertTrue("The permissions should be permitted.", getPolicyService().isPermitted(getResourceType(), permissions, user, false));
        permissions = new Permission[] {PolicyConstants.PERM_DELETE};
View Full Code Here

        T resource = createResource();
        getPolicyService().attachResourceToPolicy(resource, policy, 0, realm);
       
        getPolicyService().grantPolicyToPrincipal(policy, role);
        AccessRights accessRights = createAssignAccessRights(getResourceType().getPermissionClass());
        PropertyList selectedPolicies = PropertyList.createFromArray(new int[] {policy.getResourceId()});
        PolicyDatabaseFactory.getInstance().attachResourceToPolicyList(accessRights, selectedPolicies, getSessionInfo());
       
        Permission[] permissions = new Permission[] {PolicyConstants.PERM_ASSIGN};
        assertTrue("The permissions should be permitted.", getPolicyService().isPermitted(getResourceType(), permissions, user, false));
        permissions = new Permission[] {PolicyConstants.PERM_DELETE};
View Full Code Here

    public void testFavorites() throws Exception{
        Realm realm = getDefaultRealm();
        Policy policy = createPolicy(realm);
        T resource = createResource();
        User user = createAccount();
        PropertyList selectedPolicies = PropertyList.createFromArray(new int[] {policy.getResourceId()});
        PolicyDatabaseFactory.getInstance().attachResourceToPolicyList(resource, selectedPolicies, getSessionInfo());
        getPolicyService().grantPolicyToPrincipal(policy, user);
       
        assertEquals("There should be no favorites", 0, SystemDatabaseFactory.getInstance().getFavorites(resource.getResourceType().getResourceTypeId(), user).size());
        SystemDatabaseFactory.getInstance().addFavorite(resource.getResourceType().getResourceTypeId(), resource.getResourceId(), user.getPrincipalName());
View Full Code Here

                    String authPassword = "";
                    String preferredAuthScheme = HttpAuthenticatorFactory.BASIC;
                    String encoding = "";
                    String formType = "";
                    String formParameters = "";
                    PropertyList restrictToHosts = new PropertyList();
                    if (rs3.next()) {
                        authUsername = rs3.getString("authentication_username");
                        authPassword = rs3.getString("authentication_password");
                        preferredAuthScheme = rs3.getString("preferred_authentication_scheme");
                        encoding = rs3.getString("encoding");
                        restrictToHosts.setAsPropertyText(rs3.getString("restrict_to_hosts"));
                        formType = rs3.getString("form_type");
                        formParameters = rs3.getString("form_parameters");
                    }
                    return new ReplacementProxyWebForward(realmID, id, url, name, description, category, authUsername, authPassword,
                                    preferredAuthScheme, encoding, restrictToHosts, formType, formParameters, autoStart, created, amended);
View Full Code Here

        List<WizardActionStatus> actionStatus = new ArrayList<WizardActionStatus>();
        AbstractWizardSequence seq = getWizardSequence(request);
        SessionInfo info = this.getSessionInfo(request);
        String name = (String) seq.getAttribute(AccessRightsDetailsForm.ATTR_RESOURCE_NAME, null);
        String description = (String) seq.getAttribute(AccessRightsDetailsForm.ATTR_RESOURCE_DESCRIPTION, null);
        PropertyList permissionList = (PropertyList) seq.getAttribute(AccessRightsPermissionsForm.ATTR_SELECTED_ACCESS_RIGHTS, null);
        String permissionClass = (String) seq.getAttribute(AccessRightsDetailsForm.ATTR_RESOURCE_PERMISSION_CLASS, null);
        AccessRights accessRights = null;
        Calendar now = Calendar.getInstance();
        try {
            DefaultAccessRights defaultAccessRights = new DefaultAccessRights(info.getUser().getRealm().getRealmID(), 0, name, description, new ArrayList<AccessRight>(), permissionClass, now, now);
View Full Code Here

                    throws Exception {
        return cancel(mapping, form, request, response);
    }

    WizardActionStatus attachToPolicies(AbstractWizardSequence seq, SessionInfo info, Resource resource) {
        PropertyList selectedPolicies = (PropertyList) seq.getAttribute(AbstractWizardPolicySelectionForm.ATTR_SELECTED_POLICIES,
                        null);
        try {
            PolicyDatabaseFactory.getInstance().attachResourceToPolicyList(resource, selectedPolicies, info);
            return new WizardActionStatus(WizardActionStatus.COMPLETED_OK,
                            "accessRightsWizard.resourceFinish.status.attachedToPolicies");
View Full Code Here

     *
     * @see com.adito.wizard.forms.AbstractWizardForm#init(com.adito.wizard.AbstractWizardSequence)
     */
    public void init(AbstractWizardSequence sequence, HttpServletRequest requestthrows Exception {
        resourceName = (String)sequence.getAttribute(AccessRightsDetailsForm.ATTR_RESOURCE_NAME, Constants.SCOPE_PERSONAL);
        PropertyList l = (PropertyList)sequence.getAttribute(AccessRightsPolicySelectionForm.ATTR_SELECTED_POLICIES, null);
        selectedPolicies = new ArrayList();
        for(Iterator i = l.iterator(); i.hasNext(); ) {
            selectedPolicies.add(PolicyDatabaseFactory.getInstance().getPolicy(Integer.parseInt(i.next().toString())).getResourceName());
        }
        selectedPermissions = (PropertyList)sequence.getAttribute(AccessRightsPermissionsForm.ATTR_SELECTED_ACCESS_RIGHTS, null);;
    }
View Full Code Here

    /* (non-Javadoc)
     * @see com.adito.wizard.forms.DefaultWizardForm#init(com.adito.wizard.AbstractWizardSequence, javax.servlet.http.HttpServletRequest)
     */
    public void init(AbstractWizardSequence sequence, HttpServletRequest request) throws Exception {
        super.init(sequence, request);
        selectedAccounts = (PropertyList)sequence.getAttribute(ATTR_SELECTED_ACCOUNTS, new PropertyList());
        selectedRoles = (PropertyList)sequence.getAttribute(ATTR_SELECTED_ROLES, new PropertyList());
    }
View Full Code Here

        URL proxiedURLBase = proxyURIDetails.getProxiedURLBase();
        if (log.isDebugEnabled())
          log.debug("Proxied URL base " + proxiedURLBase.toExternalForm());

        // The web forward may restrict access to the target URL
        PropertyList restrictTo = webForward.getRestrictToHosts();
        if(!restrictTo.isEmpty()) {
            boolean found = proxiedURLBase.getHost().equals(new URL(actualURL).getHost());
            for(Iterator i = restrictTo.iterator(); !found && i.hasNext(); ) {
                String host = (String)i.next();
                if(proxiedURLBase.getHost().matches(Util.parseSimplePatternToRegExp(host))) {
                    found = true;
                }
            }
View Full Code Here

TOP

Related Classes of com.adito.boot.PropertyList

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.