nova-permission icon indicating copy to clipboard operation
nova-permission copied to clipboard

[feature] Limit BooleanGroup values

Open stickeegreg opened this issue 5 years ago • 1 comments

There doesn't seem to be an easy way to limit the roles / permissions that are available for selection in a BooleanGroup. I've done it my project by extending RoleBooleanGroup but it's not pretty as I have to duplicate some of the logic from the constructor and $this->options() is called twice.

It would be nice if RoleBooleanGroup and PermissionBooleanGroup had an optionsQuery method, similar to the way Nova Resources work - this could then be overridden in subclasses as needed.

Additionally, there's no validation that the values passed in are valid - it would be good to provide a validation rule.

My use case is I have multiple organisations that can sign up, but different organisations should have access to different roles. I can create a PR if you're interested.

stickeegreg avatar Jan 28 '20 12:01 stickeegreg

Ended up doing the same! Thank you!

pokono avatar Apr 19 '20 02:04 pokono