-
Notifications
You must be signed in to change notification settings - Fork 136
Closed
Milestone
Description
With the new user roles we have a lot of places to update regarding permission checks so the code for permission checks will be more and more complex inside containers/components, ex
made up example
if ((util.isManager(user) && !util.isAccountManager(user)) || util.isCopilot(user) || util.hasAdminRole(user)){...}
How about centralizing permission checks to a common module (or configuration file)?
For example we could have a single method for permission checks like
util.checkPermission(PERMISSIONS.EDIT_PROJECT_PLAN, user, entity) with entity parameter being the one we're checking the permission for (ex project, plan, phase, timeline, thread, etc)
What do you think @vikasrohit @maxceem @RishiRajSahu ?