Skip to content

Commit 5dcb68c

Browse files
authored
add perms check for publish action (#1325)
* add perms check for publish action * revert change to CRUD actions list * allow publish as part of allowable action types
1 parent 228ce9e commit 5dcb68c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

apps/studio/src/server/modules/page/page.router.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ export const pageRouter = router({
538538
await validateUserPermissionsForResource({
539539
userId: ctx.user.id,
540540
siteId,
541-
action: "update",
541+
action: "publish",
542542
})
543543
return publishPageResource(
544544
ctx.logger,

apps/studio/src/server/modules/permissions/permissions.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export const validateUserPermissionsForResource = async ({
8181
action,
8282
resourceId = null,
8383
...rest
84-
}: PermissionsProps & { action: CrudResourceActions }) => {
84+
}: PermissionsProps & { action: CrudResourceActions | "publish" }) => {
8585
// TODO: this is using site wide permissions for now
8686
// we should fetch the oldest `parent` of this resource eventually
8787
const hasCustomParentId = resourceId === null || action === "create"

0 commit comments

Comments
 (0)