mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
limited heroic nodes to images
This commit is contained in:
parent
6b5638b44e
commit
313c41b56c
1 changed files with 4 additions and 1 deletions
|
@ -2,6 +2,7 @@ import { USER_ROLES } from '~/redux/auth/constants';
|
|||
import { INode } from '~/redux/types';
|
||||
import { IUser } from '~/redux/auth/types';
|
||||
import path from 'ramda/es/path';
|
||||
import { NODE_TYPES } from '~/redux/node/constants';
|
||||
|
||||
export const canEditNode = (node: Partial<INode>, user: Partial<IUser>): boolean =>
|
||||
path(['role'], user) === USER_ROLES.ADMIN ||
|
||||
|
@ -11,4 +12,6 @@ export const canLikeNode = (node: Partial<INode>, user: Partial<IUser>): boolean
|
|||
path(['role'], user) && path(['role'], user) !== USER_ROLES.GUEST;
|
||||
|
||||
export const canStarNode = (node: Partial<INode>, user: Partial<IUser>): boolean =>
|
||||
path(['role'], user) && path(['role'], user) === USER_ROLES.ADMIN;
|
||||
node.type === NODE_TYPES.IMAGE &&
|
||||
path(['role'], user) &&
|
||||
path(['role'], user) === USER_ROLES.ADMIN;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue