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

ref: extract assert permission levels helper functions #703

Merged
merged 7 commits into from
Nov 23, 2020

Conversation

karrui
Copy link
Contributor

@karrui karrui commented Nov 23, 2020

Problem

This PR extracts out the logic in authentication.server.controller.js#verifyPermissions into their own utility functions so other services can use those instead of passing through the middleware.

Solution

Features:

  • add methods to assert user permissions on forms in admin-form.utils
  • use adminForm permission util fns when verifying form permissions

@karrui karrui requested review from mantariksh and tshuli November 23, 2020 02:02
Copy link
Contributor

@mantariksh mantariksh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, with a refactor suggestion

src/app/modules/form/admin-form/admin-form.utils.ts Outdated Show resolved Hide resolved
@karrui karrui requested a review from mantariksh November 23, 2020 05:28
@karrui karrui merged commit d397bac into develop Nov 23, 2020
@karrui karrui deleted the ref/split-permission-levels branch November 23, 2020 08:05
@mantariksh mantariksh mentioned this pull request Nov 24, 2020
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.

2 participants