Skip to content

Add or remove roles dynamically #3

@Emanuel-23

Description

@Emanuel-23

Would be great to add or remove roles dynamically.

So basically the idea is to

  • add a role from the defined config, if it does not exists (already possible).
  • remove a role if it is not defined in the config (AND it is not a default role !!!)

I'd suggest not to remove default rules.

@kellymears What do you think? Should not be too hard to implement :)

Edit: Might be confusing, though. If we had a whitelist of roles, that should not be removed at all, this might be difficult or impossible to maintain when it comes to custom roles, added by plugins. Maybe its a godd idea to introduce another config array, that defines all roles that could be removed dynamically. Like this:

    'removable' => [
        'mycustomRole',
        'myothercustomerrole'
    ],

or alternatively by defining it in the existing roles array like this:

    'mycustomRole' => [
        'removable' => true,
    ],
    'myothercustomerrole' => [
        'removable' => true,
    ],

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions