Examples of authorizeUser()


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

                ac.clearResourceAuthorizations("/system");

                ac.authorizeUser(systemUserName, "/system", ActionConstants.GET);
                ac.authorizeUser(systemUserName, "/system", ActionConstants.PUT);
                ac.authorizeUser(systemUserName, "/system", ActionConstants.DELETE);
                ac.authorizeUser(systemUserName, "/system", AccessControlConstants.AUTHORIZE);

                String adminUserName = CarbonConstants.REGISTRY_SYSTEM_USERNAME;

                ac.authorizeUser(adminUserName, "/system", ActionConstants.GET);
View Full Code Here

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

                ac.clearResourceAuthorizations("/system");

                ac.authorizeUser(systemUserName, "/system", ActionConstants.GET);
                ac.authorizeUser(systemUserName, "/system", ActionConstants.PUT);
                ac.authorizeUser(systemUserName, "/system", ActionConstants.DELETE);
                ac.authorizeUser(systemUserName, "/system", AccessControlConstants.AUTHORIZE);

                String adminUserName = CarbonConstants.REGISTRY_SYSTEM_USERNAME;

                ac.authorizeUser(adminUserName, "/system", ActionConstants.GET);
View Full Code Here

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

                ac.authorizeUser(systemUserName, "/system", ActionConstants.DELETE);
                ac.authorizeUser(systemUserName, "/system", AccessControlConstants.AUTHORIZE);

                String adminUserName = CarbonConstants.REGISTRY_SYSTEM_USERNAME;

                ac.authorizeUser(adminUserName, "/system", ActionConstants.GET);

                String adminRoleName = realmConfig.getAdminRoleName();
                ac.authorizeRole(adminRoleName, "/system", ActionConstants.GET);

                // any user should be able to execute auto generated queries, though the results
View Full Code Here

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

                    .getAuthorizationManager();

            String path = getSecureTopicPermissionPath(topicName);
            if (accessibleUsers != null) {
                for (String accessibleUser : accessibleUsers) {
                    authorizationManager.authorizeUser(accessibleUser,path, AUTH_WRITE_ACTION);
                    System.out.println("authorize "+ accessibleUser + " for "+ path);
                }
            }

            if (acessibleRoles != null) {
View Full Code Here

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

        } catch (Exception e) {
          // exptected error in negative testing
        }

        //***authorize user
        authMan.authorizeUser("sunil", "wall", "read");
        try {
          authMan.authorizeUser(null, "wall", "read");
          fail("Exception at authorizing a user with Null name");
        } catch (Exception e) {
          // exptected error in negative testing
View Full Code Here

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

        }

        //***authorize user
        authMan.authorizeUser("sunil", "wall", "read");
        try {
          authMan.authorizeUser(null, "wall", "read");
          fail("Exception at authorizing a user with Null name");
        } catch (Exception e) {
          // exptected error in negative testing
        }
        try {
View Full Code Here

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

          fail("Exception at authorizing a user with Null name");
        } catch (Exception e) {
          // exptected error in negative testing
        }
        try {
          authMan.authorizeUser("isuru", null, "read");
          fail("Exception at authorizing a user with Null resourceID");
        } catch (Exception e) {
          // exptected error in negative testing
        }
        try {
View Full Code Here

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

          fail("Exception at authorizing a user with Null resourceID");
        } catch (Exception e) {
          // exptected error in negative testing
        }
        try {
          authMan.authorizeUser("isuru","wall",null);
          fail("Exception at authorizing a user with Null action");
        } catch (Exception e) {
          // exptected error in negative testing
        }
        try {
View Full Code Here

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

          fail("Exception at authorizing a user with Null action");
        } catch (Exception e) {
          // exptected error in negative testing
        }
        try {
          authMan.authorizeUser("isuru","wall","run");
          fail("Exception at authorizing a user with Invalid action");
        } catch (Exception e) {
          // exptected error in negative testing
        }
       
View Full Code Here

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

        usWriter.addRole("rolex", new String[] { "saman", "amara" }, null);
        usWriter.addRole("roley", null, null);
        authMan.authorizeRole("rolex", "wall", "write");
        authMan.authorizeRole("roley", "table", "write");
        authMan.authorizeUser("sunil", "wall", "read");

        assertTrue(authMan.isUserAuthorized("saman", "wall", "write"));
        assertTrue(authMan.isUserAuthorized("sunil", "wall", "read"));
        assertTrue(authMan.isRoleAuthorized("roley", "table", "write"));
        assertFalse(authMan.isUserAuthorized("saman", "wall", "read"));
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.