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

Pundit field whitelisting #27

Closed
yourivdlans opened this issue May 7, 2019 · 1 comment
Closed

Pundit field whitelisting #27

yourivdlans opened this issue May 7, 2019 · 1 comment
Labels
stale Inactive

Comments

@yourivdlans
Copy link

First of all, thanks for this great gem! I love the simplicity.

By default this gem follows a blacklisting strategy where you disable access to queries, fields, etc. I'd like it the other way around and whitelist everything that is allowed to be used.

So far I have an implementation that works (based on other discussions on this gem).

The problem with my implementation is that for each field I will need to have a proc which tests the access.

See: https://gist.github.com/yourivdlans/7d1093e5500820804a7ca8d263c98ecf

This might grow to something unmanageable which I'd like to avoid.

What could work is if the field name would be passed into the proc, but I'm not sure if this is the right approach.

Would love to hear your opinion and thoughts :)

Thanks!

@ghost
Copy link

ghost commented May 21, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@ghost ghost added the stale Inactive label May 21, 2019
@ghost ghost closed this as completed May 28, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Inactive
Projects
None yet
Development

No branches or pull requests

1 participant