function assign($Role, $UserID = null)
	{
	    if ($UserID === null)
		    throw new \RbacUserNotProvidedException ("\$UserID is a required argument.");

		if (is_numeric($Role))
		{
			$RoleID = $Role;
		} else {
			if (substr($Role, 0, 1) == "/")
				$RoleID = Jf::$Rbac->Roles->pathId($Role);
			else
				$RoleID = Jf::$Rbac->Roles->titleId($Role);
		}

		$res = Jf::sql ( "INSERT INTO {$this->tablePrefix()}userroles
				(UserID,RoleID,AssignmentDate)
				VALUES (?,?,?)
				", $UserID, $RoleID, Jf::time () );
		return $res >= 1;
	}
function assign($Role, $UserID = null)
	{
	    if ($UserID === null)
		    throw new \RbacUserNotProvidedException ("\$UserID is a required argument.");

		if (is_numeric($Role))
		{
			$RoleID = $Role;
		} else {
			if (substr($Role, 0, 1) == "/")
				$RoleID = Jf::$Rbac->Roles->pathId($Role);
			else
				$RoleID = Jf::$Rbac->Roles->titleId($Role);
		}

		$res = Jf::sql ( "INSERT INTO {$this->tablePrefix()}userroles
				(UserID,RoleID,AssignmentDate)
				VALUES (?,?,?)
				", $UserID, $RoleID, Jf::time () );
		return $res >= 1;
	}
function assign ( $ Role , $ UserID = null ) { if ( $ UserID === null ) throw new \ RbacUserNotProvidedException ( "\$UserID is a required argument." ) ; if ( is_numeric ( $ Role ) ) { $ RoleID = $ Role ; } else { if ( substr ( $ Role , 0 , 1 ) == "/" ) $ RoleID = Jf :: $ Rbac -> Roles -> pathId ( $ Role ) ; else $ RoleID = Jf :: $ Rbac -> Roles -> titleId ( $ Role ) ; } $ res = Jf :: sql ( "INSERT INTO {$this->tablePrefix()}userroles
				(UserID,RoleID,AssignmentDate)
				VALUES (?,?,?)
				" , $ UserID , $ RoleID , Jf :: time ( ) ) ; return $ res >= 1 ; }
Assigns a role to a user

@param mixed $Role
Id, Path or Title
@param integer $UserID
UserID (use 0 for guest)

@throws RbacUserNotProvidedException
@return boolean inserted or existing
Assigns a role to a user