public function hasPermission($permission)
    {
        $perm_id = $this->getPermissionId($permission);
        $roles = $this->getRolesWithPermission($perm_id);

        foreach ($roles as $role)
            if ($this->hasRole($role))
                return true;

        return false;
    }