getjerry/nest-casl

Alias group names

ronniehicks opened this issue · 0 comments

My user's credentials are provided by AD so I have groups like "Super-Duper-Admin-User" and "Totally-Normal-Not-Admin-User" that represent "admin" and "user" groups in this application. I've gotten this package to work with these groups by something like the snippet below. I'd much rather follow the pattern in the readme. Is there a way to "alias" these super long group names to the shortened aliases?

export const permissions: Permissions<Roles, Subjects, Actions> = {
  'Super-Duper-Admin-User'({ can }) {
    can(Actions.manage, 'all');
  },

  'Totally-Normal-Not-Admin-User'({ cannot }) {
    cannot(Actions.manage);
  },
};