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-on-unauthorized is overrided by code in controller #412

Closed
phuongduy2010 opened this issue May 5, 2017 · 4 comments
Closed
Labels

Comments

@phuongduy2010
Copy link

Hello All,
When the page is loaded my check box is disabled (good, it is my expected).
When user click button the enableEditField is change to false, the checkbox is enable that mean it override the permission-on-unauthorized.
My expected is md-checkbox enable or disabled based on the permission and I also want to use ng-disabled="mycondition".



Thanks

@masterspambot
Copy link
Collaborator

I don't think permission is suitable for the case you are describing.... You should simply store the current value of "editability" in variable in controller and update it through action to changes in the button.

@phuongduy2010
Copy link
Author

phuongduy2010 commented May 5, 2017

I would like to use the permission to allow user can or can not edit some filed such as checkbox, textbox....
and also use the condition to disabled when it is in view mode, how to solve this issue or could you give some advice in this case :)
Thanks

@masterspambot
Copy link
Collaborator

You should use permission to evaluate whether user can edit/access form - lets say to enable edit button, but controlling the state of controls is responsibility of controller's logic - and you should implement editability of controls there.

@phuongduy2010
Copy link
Author

Thanks for your support , please help me closed this issue :)

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

No branches or pull requests

2 participants