Examples of Role


Examples of org.jboss.errai.security.shared.Role

    if (identity.isLoggedIn()) {
      IdentityQuery<org.picketlink.idm.model.Role> query =
              identityManager.createIdentityQuery(org.picketlink.idm.model.Role.class);
      query.setParameter(org.picketlink.idm.model.Role.ROLE_OF, identity.getAgent());
      for (org.picketlink.idm.model.Role role : query.getResultList()) {
        roles.add(new Role(role.getName()));
      }
    }

    return roles;
  }
View Full Code Here

Examples of org.jboss.errai.security.shared.api.identity.Role

*/
public abstract class SecurityInterceptor {

  protected boolean hasAllRoles(Collection<Role> roles, String[] roleNames) {
    for (String roleName : roleNames) {
      final Role role = new Role(roleName);
      if (!roles.contains(role)) {
        return false;
      }
    }

View Full Code Here

Examples of org.jboss.identity.idm.api.Role

         }
         else if (roleQuery.user != null &&
            roleQuery.group != null &&
            roleQuery.roleType != null)
         {
            Role role = identitySession.getRoleManager().getRole(roleQuery.roleType, roleQuery.user, roleQuery.group);
            if (role != null)
            {
               mainResults.add(role);
            }
            return mainResults;
View Full Code Here

Examples of org.jboss.portal.identity.Role

            userRoles = new String[roles.size()+1];
            userRoles[0] = "Authenticated";
            int index = 1;
            for(Iterator itr=roles.iterator();itr.hasNext();)
            {
               Role role = (Role)itr.next();
               userRoles[index++] = role.getName();
            }
         }
                 
         return userRoles;
      }
View Full Code Here

Examples of org.jboss.resteasy.keystone.model.Role

   @POST
   @Consumes("text/plain")
   @Produces("application/json")
   public Response create(@Context UriInfo uriInfo, String roleName) throws Exception
   {
      Role role = new Role();
      role.setName(roleName);
      create(role);
      return Response.created(uriInfo.getAbsolutePathBuilder().path(role.getId()).build()).entity(role).build();
   }
View Full Code Here

Examples of org.jboss.resteasy.skeleton.key.idm.model.data.Role

   }

   @Override
   public Role create(Realm realm, Resource resource, String roleName)
   {
      Role role = new Role();
      role.setName(roleName);
      role.setId(generateId());
      cache.put("/roles/"+role.getId(), role);
      Set<String> roles = (Set<String>)cache.get("/resources/" + resource.getId() + "/roles");
      if (roles == null)
      {
         roles = new HashSet<String>();
      }
      roles.add(role.getId());
      cache.put("/resources/" + resource.getId() + "/roles", roles);
      cache.put("/resources/" + resource.getId() + "/roles/" + role.getName(), role.getId());
      return role;
   }
View Full Code Here

Examples of org.jboss.seam.security.Role

        
         List<Permission> permissions = new ArrayList<Permission>();
  
         for (String role : selectedRoles)
         {
            Principal r = new Role(role);
            for (String action : selectedActions)
            {           
               permissions.add(new Permission(target, action, r));
            }
         }
View Full Code Here

Examples of org.jboss.seam.wiki.core.model.Role

    }

    private void setRolesAndAccessLevels(User user) {

        // We don't use Seams Role class, wiki currently only uses numeric access levels
        Role bestRole = (Role)Component.getInstance("guestRole");
        for (Role role : user.getRoles()) {
            if (role.getAccessLevel() > bestRole.getAccessLevel()) bestRole = role;
        }

        if (user.getMemberHome() != null && user.getMemberHome().getName() != null) {
            log.debug("initializing users member home instance before detaching currentUser into HTTP session");
        }

        // Outject current user and access level
        Contexts.getSessionContext().set("currentUser", user);
        Contexts.getSessionContext().set("currentAccessLevel", bestRole.getAccessLevel());

    }
View Full Code Here

Examples of org.jboss.security.identity.Role

         if (subject != null)
         {
            for(Principal p : subject.getPrincipals())
            {
               // TODO: not really true, but for the moment lets assume that the principal is also the role
               Role myRole = new SimpleRole(p.getName());
               if(methodRoles.containsRole(myRole))
                  return AuthorizationContext.PERMIT;
            }
         }
         if (ejbResource.getCallerRunAsIdentity() != null)
View Full Code Here

Examples of org.jboss.soa.esb.services.security.principals.Role

  {
    Builder builder = new SecurityConfig.Builder("SuccessfulLogin");
    builder.runAs("adminRole");
    SecurityConfig configInfo = builder.build();
    Group group = new Group("Roles");
    group.addMember(new Role("adminRole1"));

    subject.getPrincipals().add(group);

    SecurityContext context = new SecurityContext(subject, SecurityContext.getConfigurationTimeout());
    service.authenticate(configInfo, context, null);
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.