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

MINOR: nice improvement to make can methods easier to access #10130

Closed
wants to merge 1 commit into from

Conversation

sunnysideup
Copy link
Contributor

This is a small enhancements that you may or may not like to make it easier to access can Methods using the Member rather than the object.

@GuySartorelli
Copy link
Member

I don't think either of the examples in the doc comment would work in a template... for that matter I don't think it would ever be possible to pass an object in, and to pass in a class you'd have to include the full namespaced classname as a string in the template wouldn't you? I feel like $Object.canView (or can whatever else) in a template would still be a lot easier to read and use than the new method, unless I'm missing some use case.

@kinglozzer
Copy link
Member

I feel like $Object.canView (or can whatever else) in a template would still be a lot easier to read and use than the new method, unless I'm missing some use case.

Agreed, that approach also allows different can* methods that won’t be “whitelisted” in this method - e.g. canPublish etc are missing, but you can obviously add any permission checking method to the object. Thanks for the suggestion though @sunnysideup

@kinglozzer kinglozzer closed this Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants