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

Use scopes for User admin attribute updates #247

Open
github-actions bot opened this issue Mar 5, 2022 · 0 comments
Open

Use scopes for User admin attribute updates #247

github-actions bot opened this issue Mar 5, 2022 · 0 comments
Labels
todo type: discussion Issue that can be resolved with discussion type: refactor type: security Issue related to Security

Comments

@github-actions
Copy link

github-actions bot commented Mar 5, 2022

Use scopes to control who can update previously admin scoped attributes of a User model.

def update
# Allow additional attributes to be applied by admins
# (the users themselves should not have access to these)
# TODO:: Use scopes.
body = self.body.gets_to_end
if is_admin?
user.assign_admin_attributes_from_json(body)
end
user.assign_attributes_from_json(body)
save_and_respond user
end

@github-actions github-actions bot added the todo label Mar 5, 2022
@caspiano caspiano changed the title : Use scopes. Use scopes for User admin attribute updates Mar 5, 2022
@caspiano caspiano added the type: discussion Issue that can be resolved with discussion label Mar 5, 2022
@caspiano caspiano removed their assignment Mar 5, 2022
@caspiano caspiano added type: refactor type: security Issue related to Security labels Mar 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
todo type: discussion Issue that can be resolved with discussion type: refactor type: security Issue related to Security
Projects
None yet
Development

No branches or pull requests

1 participant