public function access($permission, $user_id = null)
    {
        if ($this->isSuperadmin($user_id)) {
            return true;
        }

        if ($permission === GC_PERM_SUPERADMIN) {
            return false;
        }

        return in_array($permission, $this->getPermissions($user_id));
    }
public function access($permission, $user_id = null)
    {
        if ($this->isSuperadmin($user_id)) {
            return true;
        }

        if ($permission === GC_PERM_SUPERADMIN) {
            return false;
        }

        return in_array($permission, $this->getPermissions($user_id));
    }
public function access ( $ permission , $ user_id = null ) { if ( $ this -> isSuperadmin ( $ user_id ) ) { return true ; } if ( $ permission === GC_PERM_SUPERADMIN ) { return false ; } return in_array ( $ permission , $ this -> getPermissions ( $ user_id ) ) ; }
Whether a user has an access to do something
@param string $permission
@param null|int $user_id
@return boolean
Whether a user has an access to do something