Examples of SimplePrincipal


Examples of org.jboss.as.core.security.SimplePrincipal

    }

    private Set<Principal> getPrincipalRoles(Account account) {
        final Set<Principal> roles = new HashSet<>();
        for (String role : account.getRoles()) {
            roles.add(new SimplePrincipal(role));
        }
        return roles;
    }
View Full Code Here

Examples of org.jboss.resteasy.plugins.server.embedded.SimplePrincipal

  {
    dispatcher = EmbeddedContainer.start("/", new SecurityDomain(){

      public Principal authenticate(String username, String password)
          throws SecurityException {
        return new SimplePrincipal(username);
      }

      public boolean isUserInRoll(Principal username, String role) {
        return username.getName().equals(role);
      }
View Full Code Here

Examples of org.jboss.seam.security.SimplePrincipal

      Identity identity = new Identity() {

         @Override
         public Principal getPrincipal()
         {
            return new SimplePrincipal(SEAM_USER);
         }

         @Override
         public boolean hasRole(String role)
         {
View Full Code Here

Examples of org.jboss.seam.security.SimplePrincipal

            MemberAccount acct = (MemberAccount) entityManager.createQuery(
                  "select a from MemberAccount a where a.member = :member")
                  .setParameter("member", friend)
                  .getSingleResult();
           
            Principal p = new SimplePrincipal(acct.getUsername());
           
            for (String action : selectedActions)
            {
               permissions.add(new Permission(target, action, p));
            }
View Full Code Here

Examples of org.jboss.seam.security.SimplePrincipal

     
      if (ids instanceof JpaIdentityStore) identityStore = (JpaIdentityStore) ids;
     
      if (principal instanceof String)
      {       
         return isUser ? new SimplePrincipal((String) principal) : new Role((String) principal,
               identityStore == null ? false : identityStore.isRoleConditional((String) principal));
      }     
     
      if (identityStore != null)
      {
         if (isUser && identityStore.getUserClass().equals(principal.getClass()))
         {
            return new SimplePrincipal(identityStore.getUserName(principal));
         }
        
         if (!isUser && identityStore.getRoleClass().equals(principal.getClass()))
         {
            String name = identityStore.getRoleName(principal);
View Full Code Here

Examples of org.jboss.seam.security.SimplePrincipal

   {
      List<Principal> members = new ArrayList<Principal>();
     
      for (String user : listUserMembers(role))
      {
         members.add(new SimplePrincipal(user));
      }
     
      for (String roleName : listRoleMembers(role))
      {
         members.add(new Role(roleName));
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

      throw new LoginException("Failed to decode password: "+e.getMessage()); //$NON-NLS-1$
    }
  } 

  protected Principal getIdentity() {
    Principal principal = new SimplePrincipal(this.mappedRole);
    return principal;       
  }
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

   public Subject authenticate(String user, String password) throws JMSSecurityException
   {
      if (trace) { log.trace("authenticating user " + user); }

      SimplePrincipal principal = new SimplePrincipal(user);
      char[] passwordChars = null;
      if (password != null)
      {
         passwordChars = password.toCharArray();
      }
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

   public boolean authorize(String user, Set rolePrincipals)
   {
      if (trace) { log.trace("authorizing user " + user + " for role(s) " + rolePrincipals.toString()); }

      Principal principal = user == null ? null : new SimplePrincipal(user);

      boolean hasRole = realmMapping.doesUserHaveRole(principal, rolePrincipals);

      if (trace) { log.trace("user " + user + (hasRole ? " is " : " is NOT ") + "authorized"); }
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

   public void addRole(Role r) {
      if (log.isTraceEnabled())
         log.trace("Adding role: " + r.toString());

      roles.put(r.name,r);
      SimplePrincipal p = new SimplePrincipal(r.name);
      if(r.read == true)
         read.add(p);
      if(r.write == true)
         write.add(p);
      if (r.create == true)
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.