1 import { SHARE_MEMBER_PERMISSIONS } from '@proton/shared/lib/drive/constants';
2 import { hasBit } from '@proton/shared/lib/helpers/bitset';
4 const { ADMIN, OWNER, WRITE, READ, SUPER_ADMIN } = SHARE_MEMBER_PERMISSIONS;
6 // This is deprecated, so we don't put it in enum SHARE_MEMBER_PERMISSIONS
9 export const MEMBER_PERMISSIONS = {
10 OWNS: EXEC + READ + WRITE + ADMIN + SUPER_ADMIN,
13 ADMIN_EDITOR: WRITE + READ + ADMIN,
16 export const getCanWrite = (permissions: SHARE_MEMBER_PERMISSIONS) => {
17 return hasBit(permissions, WRITE);
20 export const getCanAdmin = (permissions: SHARE_MEMBER_PERMISSIONS) => {
21 return hasBit(permissions, ADMIN);
24 export const getIsOwner = (permissions: SHARE_MEMBER_PERMISSIONS) => {
25 return hasBit(permissions, OWNER);