sanctum-tokens
sanctum-tokens copied to clipboard
Fixed list of authorisations
It would be great to have an option to only allow the ui to tick from a fixed list of authorisations/privileges rathe than a free type field.
it could be an optional method so the default behaviour stays as is.
would you be interested in this?
yeah this is a cool idea, you could do something like SanctumTokens::make()->availableAbilities(['foo', 'bar-baz']),?
Yep exactly that! I can help with it if you need?
yeah if you want to give it a go im more than ok with that. Otherwise it might be a bit before i get a chance to take a look.
On a side note i did just push up some changes to the way the plugin is deployed, so if you open a PR you might get a few checks that fail and they would be related to prettier (makes PRs much easier to read) and commit messages (following https://www.conventionalcommits.org/en/v1.0.0/). Hopefully it's straight forward for you but if you get stuck just let me know
So I actually think for my needs hideAbilities() is enough as we're using policies for resource protection. If you think this is worth adding I can work on it, but it will probably take me a couple of weeks to circle back to it.
I think it's a neat idea but i'd put it on a nice to have list unless someone else comments about wanting it. There is a bit of UI work that would need to be done to handle this.
So we can just circle back around to this whenever we get the time or have a need
Hey guys, i would love to see this... Are someone up for doing this one? Or should i work on a PR?
Hey @dbpolito yeah im down for this feature but i currently don't have the bandwidth to get this added so if you wanted to start on a PR i would be happy to chime in.
On that note, when you do open the PR the checks might fail if you don't follow Conventional Commits and you'll need to make sure you have prettier setup or run the command before commit yarn prettier-fix. I'll try to get a more detailed description setup on the readme but if you get stuck just let me know and i'll be happy to help