Examples of PermissionManagerException


Examples of org.ow2.easybeans.api.PermissionManagerException

        PolicyConfigurationFactory policyConfigurationFactory = null;
        // Init JACC
        try {
            policyConfigurationFactory = PolicyConfigurationFactory.getPolicyConfigurationFactory();
        } catch (ClassNotFoundException e) {
            throw new PermissionManagerException("Error when trying to get the PolicyConfigurationFactory object", e);
        } catch (PolicyContextException e) {
            throw new PermissionManagerException("Error when trying to get the PolicyConfigurationFactory object", e);
        }
        try {
            this.policyConfiguration = policyConfigurationFactory.getPolicyConfiguration(this.contextId, remove);
        } catch (PolicyContextException pce) {
            throw new PermissionManagerException("Error when trying to get the PolicyConfiguration object with contextId '"
                    + this.contextId + "'.'", pce);
        }

        // Policy to use
        setPolicy(Policy.getPolicy());
View Full Code Here

Examples of org.ow2.easybeans.api.PermissionManagerException

    public void delete() throws PermissionManagerException {

        try {
            this.policyConfiguration.delete();
        } catch (PolicyContextException pce) {
            throw new PermissionManagerException("Cannot delete policyConfiguration object", pce);
        }
        this.policyConfiguration = null;

        // Policy need to be refresh
        policy.refresh();
View Full Code Here

Examples of org.ow2.easybeans.api.PermissionManagerException

    public void commit() throws PermissionManagerException {
        try {
            this.policyConfiguration.commit();
            policy.refresh();
        } catch (PolicyContextException pce) {
            throw new PermissionManagerException("Cannot commit configuration", pce);
        }
    }
View Full Code Here

Examples of org.ow2.easybeans.api.PermissionManagerException

                if (methodSecurityInfo.isUnchecked()) {
                    try {
                        this.logger.debug("Adding unchecked permission {0}", methodSecurityInfo.getPermission());
                        getPolicyConfiguration().addToUncheckedPolicy(methodSecurityInfo.getPermission());
                    } catch (PolicyContextException e) {
                        throw new PermissionManagerException("Cannot add unchecked policy for method '" + methodSecurityInfo
                                + "'.", e);
                    }
                } else {
                    for (String roleName : methodSecurityInfo.getRoles()) {
                        try {
                            this.logger.debug("Adding permission {0} to role {1}", methodSecurityInfo.getPermission(), roleName);
                            getPolicyConfiguration().addToRole(roleName, methodSecurityInfo.getPermission());
                        } catch (PolicyContextException e) {
                            throw new PermissionManagerException("Cannot add rolebase policy for method '" + methodSecurityInfo
                                    + "' and for role '" + roleName + "'.", e);
                        }
                    }
                }
            }
View Full Code Here

Examples of org.ow2.easybeans.api.PermissionManagerException

                if (methodSecurityInfo.isExcluded()) {
                    try {
                        this.logger.debug("Adding excluded permission {0}", methodSecurityInfo.getPermission());
                        getPolicyConfiguration().addToExcludedPolicy(methodSecurityInfo.getPermission());
                    } catch (PolicyContextException e) {
                        throw new PermissionManagerException("Cannot add excluded policy for method '" + methodSecurityInfo
                                + "'.", e);
                    }
                }
            }
        }
View Full Code Here

Examples of org.ow2.easybeans.api.PermissionManagerException

        if (declaredRoles != null) {
            for (String role : declaredRoles) {
                try {
                    getPolicyConfiguration().addToRole(role, new EJBRoleRefPermission(beanInfo.getName(), role));
                } catch (PolicyContextException e) {
                    throw new PermissionManagerException("Cannot add to role '" + role + "' an  EJBRoleRefPermission.", e);
                }
            }
        }

        // For each security-role-ref, add an entry
        List<ISecurityRoleRef> securityRoleRefs = securityInfo.getSecurityRoleRefList();
        if (securityRoleRefs != null) {
            for (ISecurityRoleRef securityRoleRef : securityRoleRefs) {
                try {
                    getPolicyConfiguration().addToRole(securityRoleRef.getRoleLink(), new EJBRoleRefPermission(beanInfo.getName(), securityRoleRef.getRoleName()));
                } catch (PolicyContextException e) {
                    throw new PermissionManagerException("Cannot add to role-link'" + securityRoleRef.getRoleLink() + "' the EJBRoleRefPermission build with role-name '" + securityRoleRef.getRoleName() + "'.", e);
                }
            }
        }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.