Examples of ISecurityInfo


Examples of org.ow2.easybeans.api.bean.info.ISecurityInfo

     * Extract security info from the bean's metadata.
     * @param bean the metadata of the current bean.
     * @return the security info.
     */
    public static ISecurityInfo getSecurityInfo(final EasyBeansEjbJarClassMetadata bean) {
        ISecurityInfo securityInfo = new SecurityInfo(bean);

        // Add each declared role
        securityInfo.setDeclaredRole(bean.getDeclareRoles());

        // Sets the run-as role.
        String runAsRole = bean.getRunAs();
        if (runAsRole != null) {
            securityInfo.setRunAsRole(runAsRole);
        }


        // For each business method, add info.
        Collection<? extends EasyBeansEjbJarMethodMetadata> methods = bean.getMethodMetadataCollection();
        // No methods, break now
        if (methods == null) {
            return securityInfo;
        }

        for (EasyBeansEjbJarMethodMetadata method : methods) {
            // Match only business method
            if (!method.isBusinessMethod()) {
                continue;
            }

            IMethodSecurityInfo methodSecurityInfo = new MethodSecurityInfo();
            securityInfo.addMethodSecurityInfo(methodSecurityInfo);

            // Set meta-info
            methodSecurityInfo.setExcluded(method.hasDenyAll());
            methodSecurityInfo.setUnchecked(method.hasPermitAll());
            List<String> roles = method.getRolesAllowed();
View Full Code Here

Examples of org.ow2.easybeans.api.bean.info.ISecurityInfo

            throw new IllegalStateException("The isCallerInRole() method cannot be called within the operation state '"
                    + operationState + "'.");
        }

        // Get list of declared roles for this bean.
        ISecurityInfo securityInfo = this.easyBeansFactory.getBeanInfo().getSecurityInfo();
        List<String> declaredRoles = securityInfo.getDeclaredRoles();
        if (declaredRoles == null) {
            declaredRoles = new ArrayList<String>();
        }
        // Add also all security roles declared as security-role-ref
        List<ISecurityRoleRef> securityRoleRefList = securityInfo.getSecurityRoleRefList();
        if (securityRoleRefList != null) {
            for (ISecurityRoleRef securityRoleRef : securityRoleRefList) {
                if (!declaredRoles.contains(securityRoleRef.getRoleName())) {
                    declaredRoles.add(securityRoleRef.getRoleName());
                }
View Full Code Here

Examples of org.ow2.easybeans.api.bean.info.ISecurityInfo

     */
    public void translateMetadata() throws PermissionManagerException {
        List<IBeanInfo> beansInfo = this.ejbJarInfo.getBeanInfos();
        if (beansInfo != null) {
            for (IBeanInfo beanInfo : beansInfo) {
                ISecurityInfo securityInfo = beanInfo.getSecurityInfo();
                translateEjbMethodPermission(securityInfo);
                translateEjbExcludeList(securityInfo);
                translateEjbSecurityRoleRef(beanInfo, securityInfo);
            }
        }
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.