Examples of SimplePrincipal


Examples of org.jboss.security.SimplePrincipal

         Set<String> roles = getBeanMetaData().getMethodPermissions(name, sig, iface);
         permissions = new HashSet<Principal>();
         if (roles != null)
         {
            for (String role : roles)
               permissions.add(new SimplePrincipal(role));
         }
         methodPermissionsCache.put(m, permissions);
      }

      return permissions;
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

         Principal p = (Principal)iter.next();
         if(p instanceof SimpleGroup)
         {
            SimpleGroup sg = (SimpleGroup)p;
            ranAsserts = true;
            assertTrue("testRole exists?", sg.isMember(new SimplePrincipal("testRole")));
            assertTrue("testRole2 exists?", sg.isMember(new SimplePrincipal("testRole2")));
            assertTrue("Role4 exists?", sg.isMember(new SimplePrincipal("Role4")));
            if(replaceRole)
              assertFalse("Role3 does not exist?", sg.isMember(new SimplePrincipal("Role3")));
            else
               assertTrue("Role3 exists?", sg.isMember(new SimplePrincipal("Role3")));
         }
      }
      assertTrue("Ran Asserts?",ranAsserts);
   }
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

   /** Build a SimplePrincipal
    * @param text, the name of the Principal
    */
   public void setAsText(final String text)
   {
      SimplePrincipal principal = new SimplePrincipal(text);
      setValue(principal);
   }
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

{
   private HashSet requiredRoles = new HashSet();

   public RolesAuthorization()
   {
      requiredRoles.add(new SimplePrincipal("JBossAdmin"));
   }
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

      HashSet set = new HashSet();
      StringTokenizer st = new StringTokenizer(assignedRoles,",");
      while(st.hasMoreTokens())
      {
         String aRole = st.nextToken();
         set.add(new SimplePrincipal(aRole));
      }
      if(trace)
         log.trace("roles set="+set);
      return set;
   }
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

               else
               {
                  ApplicationMetaData appMetaData = con.getBeanMetaData().getApplicationMetaData();
                  String name = appMetaData.getUnauthenticatedPrincipal();
                  if (name != null)
                     caller = new SimplePrincipal(name);
               }
            }
  
            if( caller == null )
            {
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

         // Get the JBoss security manager from the ENC context
         SubjectSecurityManager securityMgr = getSubjectSecurityManager("authenticate( digest related)");
         if(securityMgr == null)
            return null;
        
         principal = new SimplePrincipal(username);
         Subject subject = new Subject();
         if (securityMgr.isValid(principal, digest, subject))
         {
            log.trace("User: " + username + " is authenticated");
            securityDomain = securityMgr.getSecurityDomain();
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

         // Get the JBoss security manager from the ENC context
         SubjectSecurityManager securityMgr = getSubjectSecurityManager("authenticate(username,cred)");
         if(securityMgr == null)
            return null;
        
         principal = new SimplePrincipal(username);
         Subject subject = new Subject();
         if (securityMgr.isValid(principal, credentials, subject))
         {
            log.trace("User: " + username + " is authenticated");
            securityDomain = securityMgr.getSecurityDomain();
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

   /**
    * Return the Principal associated with the given user name.
    */
   protected Principal getPrincipal(String username)
   {
      return new SimplePrincipal(username);
   }
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

      Set<Principal> userRoles = new HashSet<Principal>();
      if (roleNames != null)
      {
         for (int n = 0; n < roleNames.length; n++)
         {
            SimplePrincipal sp = new SimplePrincipal(roleNames[n]);
            userRoles.add(sp);
         }
      }
      return userRoles;
   }
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.