Package javax.annotation.security

Examples of javax.annotation.security.PermitAll


/*     */
/*     */   private static void addPermissions(EJBContainer container, PolicyConfiguration pc)
/*     */   {
/* 169 */     SecurityDomain sd = (SecurityDomain)container.resolveAnnotation(SecurityDomain.class);
/*     */
/* 171 */     PermitAll beanUnchecked = (PermitAll)container.resolveAnnotation(PermitAll.class);
/* 172 */     RolesAllowed beanPermissions = (RolesAllowed)container.resolveAnnotation(RolesAllowed.class);
/*     */
/* 174 */     DeclareRoles beanDeclareRolesPerms = (DeclareRoles)container.resolveAnnotation(DeclareRoles.class);
/*     */
/* 176 */     if ((beanUnchecked != null) && (beanPermissions != null))
/*     */     {
/* 178 */       throw new RuntimeException("Cannot annotate a bean with both @Unchecked and @MethodPermissions");
/*     */     }
/*     */
/* 181 */     String ejbName = container.getEjbName();
/*     */
/* 184 */     if (beanDeclareRolesPerms != null)
/*     */     {
/* 186 */       String[] rolerefs = beanDeclareRolesPerms.value();
/* 187 */       int len = rolerefs != null ? rolerefs.length : 0;
/* 188 */       for (int i = 0; i < len; i++)
/*     */       {
/*     */         try
/*     */         {
/* 192 */           pc.addToRole(rolerefs[i], new EJBRoleRefPermission(ejbName, rolerefs[i]));
/*     */         }
/*     */         catch (PolicyContextException e)
/*     */         {
/* 196 */           throw new RuntimeException(e);
/*     */         }
/*     */
/*     */       }
/*     */
/*     */     }
/*     */
/* 203 */     for (Method m : container.getBeanClass().getMethods())
/*     */     {
/* 205 */       EJBMethodPermission permission = new EJBMethodPermission(ejbName, null, m);
/* 206 */       log.trace("Creating permission: " + permission);
/*     */
/* 208 */       PermitAll unchecked = (PermitAll)container.resolveAnnotation(m, PermitAll.class);
/* 209 */       RolesAllowed permissions = (RolesAllowed)container.resolveAnnotation(m, RolesAllowed.class);
/* 210 */       DenyAll exclude = (DenyAll)container.resolveAnnotation(m, DenyAll.class);
/*     */
/* 212 */       int annotationCount = getAnnotationCount(unchecked, permissions, exclude);
/*     */
View Full Code Here


                 * Process annotations at the class level
                 */
                if (!classPermissions.contains("*") || !classPermissions.contains(clazz.getName())) {

                    RolesAllowed rolesAllowed = clazz.getAnnotation(RolesAllowed.class);
                    PermitAll permitAll = clazz.getAnnotation(PermitAll.class);

                    /*
                     * @RolesAllowed
                     */
                    if (rolesAllowed != null && permitAll != null) {
View Full Code Here

    Request request = argument.getRequest();

    // Search for annotation on the method
    Method method = request.getHandler().getMethod();
    RolesAllowed rolesAllowed = method.getAnnotation(RolesAllowed.class);
    PermitAll permitAll = method.getAnnotation(PermitAll.class);
    DenyAll denyAll = method.getAnnotation(DenyAll.class);

    // Look at parent if nothing found at method level
    if (rolesAllowed == null && permitAll == null && denyAll == null) {
      Class<?> controllerClass = method.getDeclaringClass();
View Full Code Here

                 * Process annotations at the class level
                 */
                if (!classPermissions.contains("*") || !classPermissions.contains(clazz.getName())) {

                    RolesAllowed rolesAllowed = clazz.getAnnotation(RolesAllowed.class);
                    PermitAll permitAll = clazz.getAnnotation(PermitAll.class);

                    /*
                     * @RolesAllowed
                     */
                    if (rolesAllowed != null && permitAll != null) {
View Full Code Here

    String []roleNames = null;

    if (rolesAllowed != null)
      roleNames = rolesAllowed.value();

    PermitAll permitAll = method.getAnnotation(PermitAll.class);

    if (permitAll != null || _classPermitAll != null)
      roleNames = null;
     
    DenyAll denyAll = method.getAnnotation(DenyAll.class);
View Full Code Here

TOP

Related Classes of javax.annotation.security.PermitAll

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.