Package org.wso2.carbon.user.core

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


        UserStoreManager usAdmin = realm.getUserStoreManager();
        usAdmin.addRole("everyone", null, null);
        usAdmin.addUser("sameera", "password", new String[] { "everyone", "bizzrole" }, null, null, false);
        usAdmin.addUser("dimuthug", "password", new String[] { "everyone" }, null, null, false);

        authManager.authorizeRole("everyone", "/", "read");
        authManager.authorizeRole("everyone", "/top", "read");
        //authManager.authorizeRole("everyone", "/top/wso2", "read");
        authManager.denyRole("everyone", "/top/wso2/bizzness", "read");
        authManager.authorizeRole("bizzrole", "/top/wso2/bizzness", "read");
View Full Code Here


        usAdmin.addRole("everyone", null, null);
        usAdmin.addUser("sameera", "password", new String[] { "everyone", "bizzrole" }, null, null, false);
        usAdmin.addUser("dimuthug", "password", new String[] { "everyone" }, null, null, false);

        authManager.authorizeRole("everyone", "/", "read");
        authManager.authorizeRole("everyone", "/top", "read");
        //authManager.authorizeRole("everyone", "/top/wso2", "read");
        authManager.denyRole("everyone", "/top/wso2/bizzness", "read");
        authManager.authorizeRole("bizzrole", "/top/wso2/bizzness", "read");

        assertEquals(1, authManager.getAllowedRolesForResource("/top/wso2/bizzness", "read").length);
View Full Code Here

        authManager.authorizeRole("everyone", "/", "read");
        authManager.authorizeRole("everyone", "/top", "read");
        //authManager.authorizeRole("everyone", "/top/wso2", "read");
        authManager.denyRole("everyone", "/top/wso2/bizzness", "read");
        authManager.authorizeRole("bizzrole", "/top/wso2/bizzness", "read");

        assertEquals(1, authManager.getAllowedRolesForResource("/top/wso2/bizzness", "read").length);
        assertEquals(1, authManager.getDeniedRolesForResource("/top/wso2/bizzness", "read").length);
        assertFalse(authManager.isRoleAuthorized("everyone", "/top/wso2/bizzness", "read"));
        assertFalse(authManager.isUserAuthorized("dimuthu", "/top/wso2/bizzness", "read"));
View Full Code Here

            AuthorizationManager authMan = realm.getAuthorizationManager();
            // Authorize the admin role, if not authorized yet.
            if (!authMan.isRoleAuthorized(adminRole,
                                          CarbonConstants.UI_ADMIN_PERMISSION_COLLECTION,
                                          UserMgtConstants.EXECUTE_ACTION)) {
                authMan.authorizeRole(adminRole, CarbonConstants.UI_ADMIN_PERMISSION_COLLECTION,
                                      UserMgtConstants.EXECUTE_ACTION);
            }
        } catch (UserStoreException e) {
            String msg = "Error in authorizing the admin role.";
            log.error(msg, e);
View Full Code Here

        try {
            AuthorizationManager accessControlAdmin = userRealm.getAuthorizationManager();
            String everyoneRole = CarbonConstants.REGISTRY_ANONNYMOUS_ROLE_NAME;

            accessControlAdmin.authorizeRole(everyoneRole, path, ActionConstants.GET);
            accessControlAdmin.denyRole(everyoneRole, path, ActionConstants.PUT);
            accessControlAdmin.denyRole(everyoneRole, path, ActionConstants.DELETE);
            accessControlAdmin.denyRole(everyoneRole, path, AccessControlConstants.AUTHORIZE);

        } catch (UserStoreException e) {
View Full Code Here

        try {
            AuthorizationManager accessControlAdmin = userRealm.getAuthorizationManager();
            String everyoneRole = CarbonConstants.REGISTRY_ANONNYMOUS_ROLE_NAME;

            accessControlAdmin.authorizeRole(everyoneRole, path, ActionConstants.GET);
            accessControlAdmin.denyRole(everyoneRole, path, ActionConstants.PUT);
            accessControlAdmin.denyRole(everyoneRole, path, ActionConstants.DELETE);
            accessControlAdmin.denyRole(everyoneRole, path, AccessControlConstants.AUTHORIZE);

        } catch (UserStoreException e) {
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.