org.wso2.carbon.identity.common.testng.realm

Class MockAuthorizationManager

  • java.lang.Object
    • org.wso2.carbon.identity.common.testng.realm.MockAuthorizationManager
  • All Implemented Interfaces:
    org.wso2.carbon.user.api.AuthorizationManager

    public class MockAuthorizationManager
    extends Object
    implements org.wso2.carbon.user.core.AuthorizationManager
    Simple In Memory Authorization Manager for mocking.
    • Constructor Detail

      • MockAuthorizationManager

        public MockAuthorizationManager()
    • Method Detail

      • isUserAuthorized

        public boolean isUserAuthorized(String s,
                                        String s1,
                                        String s2)
                                 throws org.wso2.carbon.user.core.UserStoreException
        Specified by:
        isUserAuthorized in interface  org.wso2.carbon.user.api.AuthorizationManager
        Throws:
        org.wso2.carbon.user.core.UserStoreException
      • isRoleAuthorized

        public boolean isRoleAuthorized(String s,
                                        String s1,
                                        String s2)
                                 throws org.wso2.carbon.user.core.UserStoreException
        Specified by:
        isRoleAuthorized in interface  org.wso2.carbon.user.api.AuthorizationManager
        Throws:
        org.wso2.carbon.user.core.UserStoreException
      • getExplicitlyAllowedUsersForResource

        public String[] getExplicitlyAllowedUsersForResource(String s,
                                                             String s1)
                                                      throws org.wso2.carbon.user.core.UserStoreException
        Specified by:
        getExplicitlyAllowedUsersForResource in interface  org.wso2.carbon.user.api.AuthorizationManager
        Throws:
        org.wso2.carbon.user.core.UserStoreException
      • getAllowedRolesForResource

        public String[] getAllowedRolesForResource(String s,
                                                   String s1)
                                            throws org.wso2.carbon.user.core.UserStoreException
        Specified by:
        getAllowedRolesForResource in interface  org.wso2.carbon.user.api.AuthorizationManager
        Throws:
        org.wso2.carbon.user.core.UserStoreException
      • getDeniedRolesForResource

        public String[] getDeniedRolesForResource(String s,
                                                  String s1)
                                           throws org.wso2.carbon.user.core.UserStoreException
        Specified by:
        getDeniedRolesForResource in interface  org.wso2.carbon.user.api.AuthorizationManager
        Throws:
        org.wso2.carbon.user.core.UserStoreException
      • getExplicitlyDeniedUsersForResource

        public String[] getExplicitlyDeniedUsersForResource(String s,
                                                            String s1)
                                                     throws org.wso2.carbon.user.core.UserStoreException
        Specified by:
        getExplicitlyDeniedUsersForResource in interface  org.wso2.carbon.user.api.AuthorizationManager
        Throws:
        org.wso2.carbon.user.core.UserStoreException
      • authorizeUser

        public void authorizeUser(String s,
                                  String s1,
                                  String s2)
                           throws org.wso2.carbon.user.core.UserStoreException
        Specified by:
        authorizeUser in interface  org.wso2.carbon.user.api.AuthorizationManager
        Throws:
        org.wso2.carbon.user.core.UserStoreException
      • authorizeRole

        public void authorizeRole(String s,
                                  String s1,
                                  String s2)
                           throws org.wso2.carbon.user.core.UserStoreException
        Specified by:
        authorizeRole in interface  org.wso2.carbon.user.api.AuthorizationManager
        Throws:
        org.wso2.carbon.user.core.UserStoreException
      • denyUser

        public void denyUser(String s,
                             String s1,
                             String s2)
                      throws org.wso2.carbon.user.core.UserStoreException
        Specified by:
        denyUser in interface  org.wso2.carbon.user.api.AuthorizationManager
        Throws:
        org.wso2.carbon.user.core.UserStoreException
      • denyRole

        public void denyRole(String s,
                             String s1,
                             String s2)
                      throws org.wso2.carbon.user.core.UserStoreException
        Specified by:
        denyRole in interface  org.wso2.carbon.user.api.AuthorizationManager
        Throws:
        org.wso2.carbon.user.core.UserStoreException
      • clearUserAuthorization

        public void clearUserAuthorization(String s,
                                           String s1,
                                           String s2)
                                    throws org.wso2.carbon.user.core.UserStoreException
        Specified by:
        clearUserAuthorization in interface  org.wso2.carbon.user.api.AuthorizationManager
        Throws:
        org.wso2.carbon.user.core.UserStoreException
      • clearUserAuthorization

        public void clearUserAuthorization(String s)
                                    throws org.wso2.carbon.user.core.UserStoreException
        Specified by:
        clearUserAuthorization in interface  org.wso2.carbon.user.api.AuthorizationManager
        Throws:
        org.wso2.carbon.user.core.UserStoreException
      • clearRoleAuthorization

        public void clearRoleAuthorization(String s,
                                           String s1,
                                           String s2)
                                    throws org.wso2.carbon.user.core.UserStoreException
        Specified by:
        clearRoleAuthorization in interface  org.wso2.carbon.user.api.AuthorizationManager
        Throws:
        org.wso2.carbon.user.core.UserStoreException
      • clearRoleActionOnAllResources

        public void clearRoleActionOnAllResources(String s,
                                                  String s1)
                                           throws org.wso2.carbon.user.core.UserStoreException
        Specified by:
        clearRoleActionOnAllResources in interface  org.wso2.carbon.user.api.AuthorizationManager
        Throws:
        org.wso2.carbon.user.core.UserStoreException
      • clearRoleAuthorization

        public void clearRoleAuthorization(String s)
                                    throws org.wso2.carbon.user.core.UserStoreException
        Specified by:
        clearRoleAuthorization in interface  org.wso2.carbon.user.api.AuthorizationManager
        Throws:
        org.wso2.carbon.user.core.UserStoreException
      • clearResourceAuthorizations

        public void clearResourceAuthorizations(String s)
                                         throws org.wso2.carbon.user.core.UserStoreException
        Specified by:
        clearResourceAuthorizations in interface  org.wso2.carbon.user.api.AuthorizationManager
        Throws:
        org.wso2.carbon.user.core.UserStoreException
      • getAllowedUIResourcesForUser

        public String[] getAllowedUIResourcesForUser(String s,
                                                     String s1)
                                              throws org.wso2.carbon.user.core.UserStoreException
        Specified by:
        getAllowedUIResourcesForUser in interface  org.wso2.carbon.user.api.AuthorizationManager
        Throws:
        org.wso2.carbon.user.core.UserStoreException
      • getTenantId

        public int getTenantId()
                        throws org.wso2.carbon.user.core.UserStoreException
        Specified by:
        getTenantId in interface  org.wso2.carbon.user.api.AuthorizationManager
        Throws:
        org.wso2.carbon.user.core.UserStoreException
      • resetPermissionOnUpdateRole

        public void resetPermissionOnUpdateRole(String s,
                                                String s1)
                                         throws org.wso2.carbon.user.core.UserStoreException
        Specified by:
        resetPermissionOnUpdateRole in interface  org.wso2.carbon.user.api.AuthorizationManager
        Throws:
        org.wso2.carbon.user.core.UserStoreException
      • refreshAllowedRolesForResource

        public void refreshAllowedRolesForResource(String s)
                                            throws org.wso2.carbon.user.api.UserStoreException
        Specified by:
        refreshAllowedRolesForResource in interface  org.wso2.carbon.user.api.AuthorizationManager
        Throws:
        org.wso2.carbon.user.api.UserStoreException
      • normalizeRoles

        public String[] normalizeRoles(String[] strings)

Copyright © 2018 WSO2. All rights reserved.