public List < Long > getRolesAssignedToPrivileges ( String id , int maxResults ) throws OAuthSystemException , OAuthProblemException , URISyntaxException { ExtractionContext context = getResource ( Constants . GET_ROLES_ASSIGNED_TO_PRIVILEGE_URL , id ) ; OneloginOAuth2JSONResourceResponse oAuth2Response = null ; String afterCursor = null ; List < Long > roleIds = new ArrayList < Long > ( maxResults ) ; while ( oAuth2Response == null || ( roleIds . size ( ) < maxResults && afterCursor != null ) ) { oAuth2Response = context . oAuthClient . resource ( context . bearerRequest , OAuth . HttpMethod . GET , OneloginOAuth2JSONResourceResponse . class ) ; if ( ( afterCursor = getRolesAssignedToPrivilegesBatch ( roleIds , context . url , context . bearerRequest , oAuth2Response ) ) == null ) { break ; } } return roleIds ; }
Gets a list of the role ids assigned to a privilege .