Skip to content

Commit

Permalink
feat(cards): show private cards to system user
Browse files Browse the repository at this point in the history
  • Loading branch information
Enkhtuvshin Narmandakh authored and Enkhtuvshin Narmandakh committed Dec 13, 2023
1 parent 02322c5 commit 898741b
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -18,6 +18,7 @@ import {
} from '../../../messageBroker';
import { IUserDocument } from '@erxes/api-utils/src/types';
import { IModels } from '../../../connectionResolver';
import { USER_ROLES } from '@erxes/api-utils/src/constants';

export interface IArchiveArgs {
pipelineId: string;
Expand Down Expand Up @@ -859,7 +860,8 @@ export const checkItemPermByUser = async (
if (
visibility === 'private' &&
!(memberIds || []).includes(user._id) &&
!hasUserInDepartment
!hasUserInDepartment &&
user?.role !== USER_ROLES.SYSTEM
) {
throw new Error('You do not have permission to view.');
}
Expand Down

0 comments on commit 898741b

Please sign in to comment.