pixelcollective / acorn-settings-roles

Configuration-based WordPress role and capability management
MIT License
6 stars 1 forks source link

Add or remove roles dynamically #3

Open Emanuel-23 opened 4 years ago

Emanuel-23 commented 4 years ago

Would be great to add or remove roles dynamically.

So basically the idea is to

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,
    ],
kellymears commented 4 years ago

If I have some time in the next week or so I want to revisit this package. I like this idea.