jstur
jstur

Reputation: 689

How can an Orchard Core module add new roles and permissions?

IPermissionProvider doesn't seem to be able to add new roles (maybe I missed something), and it also seems to only be called during the module's initial installation, which seems batty.

How can my module add new roles and permissions?

Upvotes: 0

Views: 502

Answers (1)

Dean Marcussen
Dean Marcussen

Reputation: 617

IPermissionProvider implements two methods which you can implement.

  • Task<IEnumerable<Permission>> GetPermissionsAsync() which allows your module to return a Permission which your module provides, and

  • IEnumerable<PermissionStereotype> GetDefaultStereotypes() which allows you to define what of the permissions you have created will have by default, and/or add a PermissionStereotype to define a new role.

Upvotes: 1

Related Questions