Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed list of authorisations #54

Open
ryanmitchell opened this issue Sep 17, 2021 · 7 comments
Open

Fixed list of authorisations #54

ryanmitchell opened this issue Sep 17, 2021 · 7 comments
Labels
enhancement New feature or request

Comments

@ryanmitchell
Copy link
Contributor

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?

@JeffBeltran
Copy link
Owner

yeah this is a cool idea, you could do something like SanctumTokens::make()->availableAbilities(['foo', 'bar-baz']),?

@JeffBeltran JeffBeltran added the enhancement New feature or request label Sep 17, 2021
@ryanmitchell
Copy link
Contributor Author

Yep exactly that! I can help with it if you need?

@JeffBeltran
Copy link
Owner

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

@ryanmitchell
Copy link
Contributor Author

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.

@JeffBeltran
Copy link
Owner

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

@dbpolito
Copy link

dbpolito commented Dec 8, 2021

Hey guys, i would love to see this... Are someone up for doing this one? Or should i work on a PR?

@JeffBeltran
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants