Package be.c4j.ee.security.permission

Examples of be.c4j.ee.security.permission.GenericPermissionVoter


        }

        @Override
        public GenericPermissionVoter create(Bean<GenericPermissionVoter> bean,
                                             CreationalContext<GenericPermissionVoter> creationalContext) {
            GenericPermissionVoter result = super.create(bean, creationalContext);

            // We can't move this to the Extension itself.
            // The producer of this PermissionLookup goes to the database and this isn't possible until we are completely ready.

            PermissionLookup<? extends NamedPermission> permissionLookup = CDIUtil.getBeanManually(PermissionLookup.class);
            if (permissionLookup == null) {
                throw new OctopusConfigurationException("When using the named permissions, please configure them with the PermissionLookup.  See manual ??? TODO");
            }
            result.setNamedPermission(permissionLookup.getPermission(namedPermission.name()));
            return result;
        }
View Full Code Here


        BeanManager beanmanager = BeanManagerProvider.getInstance().getBeanManager();

        for (Object permissionConstant : AnnotationUtil.getPermissionValues(customNamedCheck)) {
            String beanName = nameFactory.generatePermissionBeanName(((NamedPermission) permissionConstant).name());

            GenericPermissionVoter voter = CDIUtil.getContextualReferenceByName(beanmanager, beanName
                    , GenericPermissionVoter.class);
            result.addAll(voter.checkPermission(invocationContext));

        }
        return result;
    }
View Full Code Here

        BeanManager beanmanager = BeanManagerProvider.getInstance().getBeanManager();

        for ( Object permissionConstant :  AnnotationUtil.getRoleValues(customNamedCheck)) {
            String beanName = nameFactory.generateRoleBeanName(((NamedRole) permissionConstant).name());

            GenericPermissionVoter voter = CDIUtil.getContextualReferenceByName(beanmanager,  beanName
                    , GenericPermissionVoter.class);
            result.addAll(voter.checkPermission(invocationContext));

        }
        return result;
    }
View Full Code Here

TOP

Related Classes of be.c4j.ee.security.permission.GenericPermissionVoter

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.