forked from coracle/flotilla
refactor: address PR review feedback for RBAC
This commit is contained in:
@@ -17,11 +17,7 @@
|
||||
import Report from "@app/components/Report.svelte"
|
||||
import EventShare from "@app/components/EventShare.svelte"
|
||||
import EventDeleteConfirm from "@app/components/EventDeleteConfirm.svelte"
|
||||
import {
|
||||
deriveUserIsSpaceAdmin,
|
||||
deriveHasPermission,
|
||||
ROOM_PERMISSION_DELETE_EVENT,
|
||||
} from "@app/core/roles"
|
||||
import {deriveHasPermission, ROOM_PERMISSION_DELETE_EVENT} from "@app/core/roles"
|
||||
import {hasNip29} from "@app/core/state"
|
||||
import {pushModal} from "@app/util/modal"
|
||||
import {pushToast} from "@app/util/toast"
|
||||
@@ -39,9 +35,7 @@
|
||||
|
||||
const isRoot = event.kind !== COMMENT
|
||||
const h = getTagValue("h", event.tags)
|
||||
const canDelete = h
|
||||
? deriveHasPermission(url, h, ROOM_PERMISSION_DELETE_EVENT)
|
||||
: deriveUserIsSpaceAdmin(url)
|
||||
const canDelete = deriveHasPermission(url, h, ROOM_PERMISSION_DELETE_EVENT)
|
||||
|
||||
const report = () => pushModal(Report, {url, event})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user