import { PCN_GET_DESTINATIONS, PCN_POST_PUBLISHER, PCN_PUT_PUBLISHER } from '@/modules/@common/acl/constants';
import { ACCOUNT } from '@/modules/@common/user/constants/rolesType';

import { hasPermission } from '@/modules/@common/user/helpers';

export const getHasAccount = (userRoleType) => userRoleType === ACCOUNT;
export const getCanReadOnly = (id, userPermissions) =>
  !(id ? hasPermission(PCN_PUT_PUBLISHER, userPermissions) : hasPermission(PCN_POST_PUBLISHER, userPermissions));
export const shouldDisablePublish = (userPermissions) => !hasPermission(PCN_GET_DESTINATIONS, userPermissions);
