src/Jaspersoft/Service/RoleService.php
public function searchRoles($organization = null, $includeSubOrgs = null, $user = null, $hasAllUsers = false, $q = null, $limit = 0, $offset = 0)
    {
        $result = array();
        $url = self::makeUrl($organization, null, compact('includeSubOrgs', 'user', 'hasAllUsers', 'q', 'limit', 'offset'));
        $data = $this->service->prepAndSend($url, array(200, 204), 'GET', null, true, 'application/json', 'application/json');
        $data = (!empty($data)) ? json_decode($data, true) : null;
        if ($data === null)
            return $result;
        foreach ($data['role'] as $r)
            $result[] = @new Role($r['name'], $r['tenantId'], $r['externallyDefined']);
        return $result;
    }
public function searchRoles($organization = null, $includeSubOrgs = null, $user = null, $hasAllUsers = false, $q = null, $limit = 0, $offset = 0)
    {
        $result = array();
        $url = self::makeUrl($organization, null, compact('includeSubOrgs', 'user', 'hasAllUsers', 'q', 'limit', 'offset'));
        $data = $this->service->prepAndSend($url, array(200, 204), 'GET', null, true, 'application/json', 'application/json');
        $data = (!empty($data)) ? json_decode($data, true) : null;
        if ($data === null)
            return $result;
        foreach ($data['role'] as $r)
            $result[] = @new Role($r['name'], $r['tenantId'], $r['externallyDefined']);
        return $result;
    }
public function searchRoles ( $ organization = null , $ includeSubOrgs = null , $ user = null , $ hasAllUsers = false , $ q = null , $ limit = 0 , $ offset = 0 ) { $ result = array ( ) ; $ url = self :: makeUrl ( $ organization , null , compact ( 'includeSubOrgs' , 'user' , 'hasAllUsers' , 'q' , 'limit' , 'offset' ) ) ; $ data = $ this -> service -> prepAndSend ( $ url , array ( 200 , 204 ) , 'GET' , null , true , 'application/json' , 'application/json' ) ; $ data = ( ! empty ( $ data ) ) ? json_decode ( $ data , true ) : null ; if ( $ data === null ) return $ result ; foreach ( $ data [ 'role' ] as $ r ) $ result [ ] = @ new Role ( $ r [ 'name' ] , $ r [ 'tenantId' ] , $ r [ 'externallyDefined' ] ) ; return $ result ; }
Search for many or all roles on the server.
You can search by organization as well.

@param string $organization
@param boolean $includeSubOrgs Return roles from suborganizations?
@param array $user retrieves the roles of specific user(s) in the array, users must be defined as username|organization if multitenancy is enabled (pro)
@param boolean $hasAllUsers Return the intersection of roles defined on all users in $user?
@param string $q A query string
@param int $limit Limit number of results for pagination
@param int $offset Begin search results from this point
@return array
@throws \Jaspersoft\Exception\RESTRequestException
Search for many or all roles on the server . You can search by organization as well .