Package org.wso2.carbon.user.core

Examples of org.wso2.carbon.user.core.AuthorizationManager.authorizeRole()


        assertFalse(authMan.isRoleAuthorized("role1", "s/t/u/v/w", "read"));
        assertFalse(authMan.isUserAuthorized("dimuthu","s/t/u/v/w", "read"));
        assertTrue(authMan.isRoleAuthorized("role1", "/s/t", "read"));
        assertTrue(authMan.isUserAuthorized("dimuthu","/s/t", "read"));

        authMan.authorizeRole("role1", "/s/t/u/v/w/x", "read");
        assertTrue(authMan.isRoleAuthorized("role1", "/s/t/u/v/w/x/y", "read"));
        assertTrue(authMan.isRoleAuthorized("role1", "/s/t", "read"));
        assertFalse(authMan.isRoleAuthorized("role1", "/s/t/u/v/w", "read"));

      
View Full Code Here


        AuthorizationManager authMan = realm.getAuthorizationManager();
        UserStoreManager usWriter = realm.getUserStoreManager();

        usWriter.addRole("rolex", new String[] { "saman", "amara" }, null);
        usWriter.addRole("roley", null, null);
        authMan.authorizeRole("rolex", "wall", "write");
        authMan.authorizeRole("roley", "table", "write");
        try {
          authMan.authorizeRole(null, "wall", "write");
          fail("Exception at authorizing a role with Null role");
        } catch (Exception e) {
View Full Code Here

        UserStoreManager usWriter = realm.getUserStoreManager();

        usWriter.addRole("rolex", new String[] { "saman", "amara" }, null);
        usWriter.addRole("roley", null, null);
        authMan.authorizeRole("rolex", "wall", "write");
        authMan.authorizeRole("roley", "table", "write");
        try {
          authMan.authorizeRole(null, "wall", "write");
          fail("Exception at authorizing a role with Null role");
        } catch (Exception e) {
          // caught exception
View Full Code Here

        usWriter.addRole("rolex", new String[] { "saman", "amara" }, null);
        usWriter.addRole("roley", null, null);
        authMan.authorizeRole("rolex", "wall", "write");
        authMan.authorizeRole("roley", "table", "write");
        try {
          authMan.authorizeRole(null, "wall", "write");
          fail("Exception at authorizing a role with Null role");
        } catch (Exception e) {
          // caught exception
        }
        try {
View Full Code Here

          fail("Exception at authorizing a role with Null role");
        } catch (Exception e) {
          // caught exception
        }
        try {
          authMan.authorizeRole("rollee", null, "write");
          fail("Exception at authorizing a role with Null resourceID");
        } catch (Exception e) {
          // caught exception
        }
        try {
View Full Code Here

          fail("Exception at authorizing a role with Null resourceID");
        } catch (Exception e) {
          // caught exception
        }
        try {
          authMan.authorizeRole("rollee","wall",null);
          fail("Exception at authorizing a role with Null action");
        } catch (Exception e) {
          // caught exception
        }
        try {
View Full Code Here

          fail("Exception at authorizing a role with Null action");
        } catch (Exception e) {
          // caught exception
        }
        try {
          authMan.authorizeRole("rolleex","wall","run");
          fail("Exception at authorizing a role with Invalid action");
        } catch (Exception e) {
          // caught exception
        }
View Full Code Here

        AuthorizationManager authManager = realm.getAuthorizationManager();
        authManager.authorizeUser("dish", "/r1/", "read");
        authManager.denyUser("dish", "/r1/r2", "read");
        assertFalse(authManager.isUserAuthorized("dish", "/x1/x2", "read"));

        authManager.authorizeRole("role1", "/x1", "read");
        authManager.denyRole("role1", "/x1/x2", "read");
        assertFalse(authManager.isRoleAuthorized("role1", "/x1/x2", "read"));

        assertTrue(authManager.isRoleAuthorized("role1", "/x1", "read"));
        usManager.updateRoleName("role1", "role2");
View Full Code Here

        assertTrue(authManager.isUserAuthorized("user1", "/x1", "read"));
       
        usManager.addRole("bizdevrole", null, null);
        usManager.addUser("bizuser", "pass2", new String[] { "bizdevrole", "everyone" }, null, null, false);
       
        authManager.authorizeRole("everyone", "/", "read");
        authManager.denyRole("everyone", "/wso2/bizzness", "read");
        authManager.authorizeRole("bizdevrole", "/wso2/bizzness", "read");
        assertTrue(authManager.isUserAuthorized("bizuser", "/wso2/bizzness", "read"));
    }
   
View Full Code Here

        usManager.addRole("bizdevrole", null, null);
        usManager.addUser("bizuser", "pass2", new String[] { "bizdevrole", "everyone" }, null, null, false);
       
        authManager.authorizeRole("everyone", "/", "read");
        authManager.denyRole("everyone", "/wso2/bizzness", "read");
        authManager.authorizeRole("bizdevrole", "/wso2/bizzness", "read");
        assertTrue(authManager.isUserAuthorized("bizuser", "/wso2/bizzness", "read"));
    }
   
    public void checkRepeatingPermission() throws Exception {
        AuthorizationManager authManager = realm.getAuthorizationManager();
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.