import { MemberRoles } from '../constants';
const ADMIN = 'global-admin';
const {
  COMMUNITY_MODERATOR,
  CHANNEL_MODERATOR,
  MODERATOR,
  SUPER_MODERATOR,
  MEMBER
} = MemberRoles;
export const isMember = userRoles => {
  if (!(userRoles !== null && userRoles !== void 0 && userRoles.length)) {
    return false;
  }
  return userRoles.includes(MEMBER);
};
export const isModerator = userRoles => {
  if (!(userRoles !== null && userRoles !== void 0 && userRoles.length)) {
    return false;
  }
  const roles = [COMMUNITY_MODERATOR, CHANNEL_MODERATOR, MODERATOR, SUPER_MODERATOR];
  return userRoles.some(role => roles.includes(role));
};
export const isAdmin = userRoles => {
  if (!(userRoles !== null && userRoles !== void 0 && userRoles.length)) {
    return false;
  }
  return userRoles.includes(ADMIN);
};
//# sourceMappingURL=role.js.map