mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
chore(core): better doc action error message (#10288)
This commit is contained in:
@@ -5,7 +5,7 @@ import { groupBy } from 'lodash-es';
|
||||
|
||||
import {
|
||||
CanNotBatchGrantDocOwnerPermissions,
|
||||
DocAccessDenied,
|
||||
DocActionDenied,
|
||||
EventBus,
|
||||
OnEvent,
|
||||
SpaceAccessDenied,
|
||||
@@ -552,7 +552,7 @@ export class PermissionService {
|
||||
user?: string
|
||||
) {
|
||||
if (!(await this.tryCheckPage(ws, page, action, user))) {
|
||||
throw new DocAccessDenied({ spaceId: ws, docId: page });
|
||||
throw new DocActionDenied({ spaceId: ws, docId: page, action });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import type { WorkspaceDoc as PrismaWorkspaceDoc } from '@prisma/client';
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
|
||||
import {
|
||||
DocAccessDenied,
|
||||
DocActionDenied,
|
||||
DocDefaultRoleCanNotBeOwner,
|
||||
DocIsNotPublic,
|
||||
ExpectToGrantDocUserRoles,
|
||||
@@ -662,7 +662,7 @@ export class DocResolver {
|
||||
user.id
|
||||
);
|
||||
} catch (error) {
|
||||
if (error instanceof DocAccessDenied) {
|
||||
if (error instanceof DocActionDenied) {
|
||||
this.logger.log(
|
||||
`User does not have permission to update page default role (${JSON.stringify(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user