public function attachRole( core_kernel_classes_Resource $user,  core_kernel_classes_Resource $role)
    {
    	try{
	        if (false === $this->userHasRoles($user, $role)){
	        	$rolesProperty = new core_kernel_classes_Property(GenerisRdf::PROPERTY_USER_ROLES);
	        	$user->setPropertyValue($rolesProperty, $role);	
	        }
        }
        catch (common_Exception $e){
        	$roleUri = $role->getUri;
        	$userUri = $user->getUri();
        	$msg = "An error occured while attaching role '${roleUri}' to user '${userUri}': " . $e->getMessage();
        	throw new core_kernel_users_Exception($msg);
        }
    }
public function attachRole( core_kernel_classes_Resource $user,  core_kernel_classes_Resource $role)
    {
    	try{
	        if (false === $this->userHasRoles($user, $role)){
	        	$rolesProperty = new core_kernel_classes_Property(GenerisRdf::PROPERTY_USER_ROLES);
	        	$user->setPropertyValue($rolesProperty, $role);	
	        }
        }
        catch (common_Exception $e){
        	$roleUri = $role->getUri;
        	$userUri = $user->getUri();
        	$msg = "An error occured while attaching role '${roleUri}' to user '${userUri}': " . $e->getMessage();
        	throw new core_kernel_users_Exception($msg);
        }
    }
public function attachRole ( core_kernel_classes_Resource $ user , core_kernel_classes_Resource $ role ) { try { if ( false === $ this -> userHasRoles ( $ user , $ role ) ) { $ rolesProperty = new core_kernel_classes_Property ( GenerisRdf :: PROPERTY_USER_ROLES ) ; $ user -> setPropertyValue ( $ rolesProperty , $ role ) ; } } catch ( common_Exception $ e ) { $ roleUri = $ role -> getUri ; $ userUri = $ user -> getUri ( ) ; $ msg = "An error occured while attaching role '${roleUri}' to user '${userUri}': " . $ e -> getMessage ( ) ; throw new core_kernel_users_Exception ( $ msg ) ; } }
Attach a Generis Role to a given Generis User. A UserException will be
if an error occurs. If the User already has the role, nothing happens.

@access public
@author Jerome Bogaerts, <jerome@taotesting.com>
@param  Resource user The User you want to attach a Role.
@param  Resource role A Role to attach to a User.
@return void
Attach a Generis Role to a given Generis User . A UserException will be if an error occurs . If the User already has the role nothing happens .