Examples of denyRole()


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

                            accessControlAdmin.authorizeRole(permRole, resourcePath, AccessControlConstants.AUTHORIZE);
                            notificationResponse += " AUTHORIZE: Allowed.";
                        }
                    } else if (action.equals("ad")) {
                        if (checked.equals("true")) {
                            accessControlAdmin.denyRole(permRole, resourcePath, AccessControlConstants.AUTHORIZE);
                            notificationResponse += " AUTHORIZE: Denied.";
                        }
                    }
                }
View Full Code Here

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

        assertFalse(authMan.isUserAuthorized("saman", "wall", "read"));
        assertFalse(authMan.isUserAuthorized("sunil", "wall", "write"));
        assertEquals(1, authMan.getAllowedRolesForResource("wall", "write").length);
        assertEquals(1, authMan.getExplicitlyAllowedUsersForResource("wall", "read").length);

        authMan.denyRole("rolex", "wall", "write");
        assertFalse(authMan.isRoleAuthorized("rolex", "wall", "write"));

        authMan.denyUser("saman", "wall", "read");
        assertFalse(authMan.isUserAuthorized("saman", "wall", "read"));
View Full Code Here

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

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

        authMan.denyRole("role1", "/s/t/u", "read");
        assertFalse(authMan.isRoleAuthorized("role1", "/s/t/u", "read"));
        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"));
View Full Code Here

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

        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");
        assertTrue(authManager.isRoleAuthorized("role2", "/x1", "read"));
View Full Code Here

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

       
        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 {
View Full Code Here

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

        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);
        assertEquals(1, authManager.getDeniedRolesForResource("/top/wso2/bizzness", "read").length);
        assertFalse(authManager.isRoleAuthorized("everyone", "/top/wso2/bizzness", "read"));
View Full Code Here

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

        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) {
            String msg = "Could not set authorizations for the " + path + ".";
View Full Code Here

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

            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) {
            String msg = "Could not set authorizations for the " + path + ".";
            log.error(msg, e);
View Full Code Here

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

            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) {
            String msg = "Could not set authorizations for the " + path + ".";
            log.error(msg, e);
            throw new RegistryException(msg);
View Full Code Here

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

                throw new RegistryException(msg, e);
            }

            String everyoneRole = realmConfig.getEveryOneRoleName();

            accessControlAdmin.denyRole(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.