public function hasPermission($permission)
    {
        return (is_array($this->permissions) &&
                isset($this->permissions[$permission]) &&
                $this->permissions[$permission] == true
               ) ||
               (
                   isset($this->permissions['administrator']) &&
                $this->permissions['administrator'] == true
               );
    }