App\Services\Access\Access::allow PHP Method

allow() public method

Check if the current user has a permission by its name or id
public allow ( string $permission ) : boolean
$permission string Permission name or id.
return boolean
    public function allow($permission)
    {
        if ($user = $this->user()) {
            return $user->allow($permission);
        }
        return false;
    }

Usage Example

 /**
  * Check if the current user has a permission by its name or id
  *
  * @param string $permission Permission name or id.
  * @return bool 
  * @static 
  */
 public static function allow($permission)
 {
     return \App\Services\Access\Access::allow($permission);
 }