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

permission-sref state params #442

Open
Jcbobo opened this issue Feb 26, 2018 · 0 comments
Open

permission-sref state params #442

Jcbobo opened this issue Feb 26, 2018 · 0 comments

Comments

@Jcbobo
Copy link

Jcbobo commented Feb 26, 2018

Hello,
I need to set up a permission based on state parameters not only to state name, brief example you can access the state /places/:id only if the id is related to you.
I was able to handle this at steate level then i move to view level.

there are already some closed issues about this, but asking for "extra" stuff #431, #434 basically the problem is the same, handling permission based on some "data" constraint, that can be handled in states but not in views (at the moment)

  1. try dynamic roles name try to create roles like house_id but not able to use it in permission-only
  2. try static roles with parameter based validation, the validate role funtcion has no parameter and look at global obj PermTransitionProperties popolated on state change (and only on state change)
  3. try to modified permission directive for override PermTransitionProperties but having two permission permission-sref usage in the same view take only the latest value of parameters (is a global object so is normal)

I think that having the same behavior both in state and view will be a big plus, bur removing the helper and passing to a map PermStatePermissionMap is tricky and can lead to breack compatibility,
what is your idea about that?

-----edit
modified authorizeByStateName passing extra params (options) that is propagated untile role/permission validation function (if not passed the helper for transition will be present), i will submit a PR in few

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

No branches or pull requests

1 participant