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

remult.isAllowed should also support @BackendMethod #69

Open
noam-honig opened this issue May 31, 2022 · 0 comments
Open

remult.isAllowed should also support @BackendMethod #69

noam-honig opened this issue May 31, 2022 · 0 comments

Comments

@noam-honig
Copy link
Collaborator

noam-honig commented May 31, 2022

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

In have a Backend method where it's allowed options determines who is allowed to run it:

@BackendMethod({ allowed: Allow.authenticated })

In the frontend, I would like to display the button only to users who can run the BackendMethod.
Today the only way I can do that, requires me to repeat myself and write:

remult.isAllowed(Allow.authenticated)

Describe the solution you'd like
A clear and concise description of what you want to happen.
I would prefer to have a single source of truth, meaning that if I defined the rule once in the backend method, I should be able to query it using something like:

remult.isAllowed(TasksController.setAll)

and that it'll take into consideration the allowed: AllowAuthenticated
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants