public function getUserRoles( core_kernel_classes_Resource $user)
    {
        $returnValue = array();
        // We use a Depth First Search approach to flatten the Roles Graph.
        $rolesProperty = new core_kernel_classes_Property(GenerisRdf::PROPERTY_USER_ROLES);
        $rootRoles = $user->getPropertyValuesCollection($rolesProperty);
        
        foreach ($rootRoles->getIterator() as $r){
        	$returnValue[$r->getUri()] = $r;
        	$returnValue = array_merge($returnValue, $this->getIncludedRoles($r));
        }
        
        $returnValue = array_unique($returnValue);
        
        return (array) $returnValue;
    }
public function getUserRoles( core_kernel_classes_Resource $user)
    {
        $returnValue = array();
        // We use a Depth First Search approach to flatten the Roles Graph.
        $rolesProperty = new core_kernel_classes_Property(GenerisRdf::PROPERTY_USER_ROLES);
        $rootRoles = $user->getPropertyValuesCollection($rolesProperty);
        
        foreach ($rootRoles->getIterator() as $r){
        	$returnValue[$r->getUri()] = $r;
        	$returnValue = array_merge($returnValue, $this->getIncludedRoles($r));
        }
        
        $returnValue = array_unique($returnValue);
        
        return (array) $returnValue;
    }
public function getUserRoles ( core_kernel_classes_Resource $ user ) { $ returnValue = array ( ) ; // We use a Depth First Search approach to flatten the Roles Graph. $ rolesProperty = new core_kernel_classes_Property ( GenerisRdf :: PROPERTY_USER_ROLES ) ; $ rootRoles = $ user -> getPropertyValuesCollection ( $ rolesProperty ) ; foreach ( $ rootRoles -> getIterator ( ) as $ r ) { $ returnValue [ $ r -> getUri ( ) ] = $ r ; $ returnValue = array_merge ( $ returnValue , $ this -> getIncludedRoles ( $ r ) ) ; } $ returnValue = array_unique ( $ returnValue ) ; return ( array ) $ returnValue ; }
Get the roles that a given user has.

@access public
@author Jerome Bogaerts, <jerome@taotesting.com>
@param  Resource user A Generis User.
@return array
Get the roles that a given user has .