Examples of authorize()


Examples of org.jboss.as.controller.security.ServerSecurityManager.authorize()

        final MethodInterfaceType methodIntfType = this.getMethodInterfaceType(componentView.getPrivateData(MethodIntf.class));

        // set the JACC contextID before calling the security manager.
        final String previousContextID = setContextID(this.contextID);
        try {
            if (!securityManager.authorize(ejbComponent.getComponentName(), componentView.getProxyClass().getProtectionDomain().getCodeSource(),
                methodIntfType.name(), this.viewMethod, this.getMethodRolesAsPrincipals(), this.contextID))
                throw MESSAGES.invocationOfMethodNotAllowed(invokedMethod,ejbComponent.getComponentName());
        }
        finally {
            // reset the previous JACC contextID.
View Full Code Here

Examples of org.jboss.as.core.security.ServerSecurityManager.authorize()

                try {
                    AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                        @Override
                        public ProtectionDomain run() {

                            if (!securityManager.authorize(ejbComponent.getComponentName(), componentView.getProxyClass().getProtectionDomain().getCodeSource(),
                                    methodIntfType.name(), AuthorizationInterceptor.this.viewMethod, AuthorizationInterceptor.this.getMethodRolesAsPrincipals(), AuthorizationInterceptor.this.contextID)) {
                                throw EjbLogger.ROOT_LOGGER.invocationOfMethodNotAllowed(invokedMethod,ejbComponent.getComponentName());
                            }
                            return null;
                        }
View Full Code Here

Examples of org.jboss.jms.server.SecurityManager.authorize()

      Set principals = checkType == CheckType.READ ? securityMetadata.getReadPrincipals() :
                       checkType == CheckType.WRITE ? securityMetadata.getWritePrincipals() :
                       securityMetadata.getCreatePrincipals();
      try
      {
         if (!sm.authorize(conn.getUsername(), principals))
         {
            String msg = "User: " + conn.getUsername() +
               " is not authorized to " +
               (checkType == CheckType.READ ? "read from" :
                  checkType == CheckType.WRITE ? "write to" : "create durable sub on") +
View Full Code Here

Examples of org.jboss.jms.server.SecurityStore.authorize()

      Set principals = checkType == CheckType.READ ? securityMetadata.getReadPrincipals() :
                       checkType == CheckType.WRITE ? securityMetadata.getWritePrincipals() :
                       securityMetadata.getCreatePrincipals();
      try
      {
         if (!sm.authorize(conn.getUsername(), principals, checkType))
         {
            String msg = "User: " + conn.getUsername() +
               " is not authorized to " +
               (checkType == CheckType.READ ? "read from" :
                  checkType == CheckType.WRITE ? "write to" : "create durable sub on") +
View Full Code Here

Examples of org.jboss.security.AuthorizationManager.authorize()

      map.put("catalina.context", context);
      map.put("authorizationManager",authzManager);
      WebResource resource = new WebResource(map);
      try
      {
         int check = authzManager.authorize(resource);
         isAuthorized = (check == AuthorizationContext.PERMIT);
      }
      catch (Exception e)
      {
         isAuthorized = false;
View Full Code Here

Examples of org.jboss.security.AuthorizationManager.authorize()

      map.put("catalina.context", context);
      map.put("authorizationManager",authzManager);
      WebResource resource = new WebResource(map);
      try
      {
         int check = authzManager.authorize(resource);
         isAuthorized = (check == AuthorizationContext.PERMIT);
      }
      catch (Exception e)
      {
         isAuthorized = false;
View Full Code Here

Examples of org.jboss.security.authorization.AuthorizationContext.authorize()

      {
         log.error("Error obtaining AuthenticatedSubject:",e);
      }
      AuthorizationContext ac = new JBossAuthorizationContext(this.securityDomain,subject,
            this.callbackHandler );
      return ac.authorize(resource);
  
  
   /** Does the current Subject have a role(a Principal) that equates to one
    of the role names. This method obtains the Group named 'Roles' from
    the principal set of the currently authenticated Subject as determined
View Full Code Here

Examples of org.jboss.security.authorization.AuthorizationModule.authorize()

         AuthorizationModule module = (AuthorizationModule)modules.get(i);
         ControlFlag flag = (ControlFlag)this.controlFlags.get(i);
         int decision = DENY;
         try
         {
            decision = module.authorize(resource);
         }
         catch(Exception ae)
         {
            decision = DENY;
            if(moduleException == null)
View Full Code Here

Examples of org.jboss.security.authorization.modules.ejb.EJBPolicyModuleDelegate.authorize()

      resource.setPrincipal(new SimplePrincipal("AuthenticatedPrincipal"));
      resource.setEjbMethod(DummyClass.class.getDeclaredMethods()[0]);
      resource.setEjbName(DummyClass.class.getCanonicalName());
      resource.setEjbMethodRoles( getRoleGroup(new String[] {"gooduser"}) );
     
      assertEquals(AuthorizationContext.PERMIT,epmd.authorize(resource,
            new Subject(),
            getRoleGroup(new String[]{"gooduser", "validuser" })) );
   }
  
   /**
 
View Full Code Here

Examples of org.jboss.security.authorization.modules.ejb.EJBXACMLPolicyModuleDelegate.authorize()

      PolicyRegistration policyRegistration = new JBossPolicyRegistration();
      registerPolicy(policyRegistration);
      EJBResource er = getEJBResource(policyRegistration);
     
      er.setPolicyContextID(contextID);
      int res = pc.authorize(er, new Subject(), getRoleGroup());
      assertEquals(AuthorizationContext.PERMIT, res);
   }
  
   public void testInvalidEJBPolicyContextHandler() throws Exception
   {
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.