public function setRoleToUsers( core_kernel_classes_Resource $role, $users = array())
    {
        $returnValue = (bool) false;
        $userService = tao_models_classes_UserService::singleton();

        $rolesProperty = new core_kernel_classes_Property(GenerisRdf::PROPERTY_USER_ROLES);
    	foreach ($users as $u){
    		$u = ($u instanceof core_kernel_classes_Resource) ? $u : new core_kernel_classes_Resource($u);

    		// just in case of ...
    		$userService->unnatachRole($u, $role);

    		// assign the new role.
    		$u->setPropertyValue($rolesProperty, $role);

    		if (common_session_SessionManager::getSession()->getUserUri() == $u->getUri()) {
    		    common_session_SessionManager::getSession()->refresh();
    		}
    	}

    	$returnValue = true;

        return (bool) $returnValue;
    }