taskcafe/migrations
Jordan Knott e64f6f8569 feat: enforce user roles
enforces user admin role requirement for
- creating / deleting / setting role for organization users
- creating / deleting / setting role for project users
- updating project name
- deleting project

hides action elements based on role for
- admin console
- team settings if team is only visible through project membership
- add project tile if not team admin
- project name text editor if not team / project admin
- add redirect from team page if settings only visible through project
  membership
- add redirect from admin console if not org admin

role enforcement is handled on the api side through a custom GraphQL
directive `hasRole`. on the client side, role information is fetched in
the TopNavbar's `me` query and stored in the `UserContext`.

there is a custom hook, `useCurrentUser`, that provides a user object
with two functions, `isVisibile` & `isAdmin` which is used to check
roles in order to render/hide relevant UI elements.
2020-08-11 21:03:21 -05:00
..
0001_add-refresh-token-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0002_add-user_account-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0003_add-team-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0004_add-project-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0005_add-task-group-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0006_add-task.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0007_add-organization-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0008_add-org-id-to-team-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0009_add-task-assigned-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0010_add-description-to-task-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0011_add-label-color-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0012_add-project-label-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0013_add-due-date-to-task-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0014_add-owner-column-to-project-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0015_add-task-label-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0016_add-profile_bg_color-column-to-user-account-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0017_add-profile-bg-delete-cascade.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0018_add-name-column-to-label-color.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0019_add-unique-constraint-project-label-and-task-on-task-label.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0020_add-full-name-column-to-user_account-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0021_drop-first-name-column-from-user_account-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0022_drop-last-name-column-from-user_account-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0023_add-initials-column-to-user_account-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0024_add-profile-avatar-url-column-to-user_account-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0025_add-cascade-delete-to-task-id-fk-on-task_label.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0026_add-cascade-delete-to-task-id-fk-on-task_assigned.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0027_add-cascade-delete-to-task_group_id-fk-on-task.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0028_add-complete-column-to-task-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0029_add-task_checklist.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0030_add-task_checklist_item.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0031_add-team-member-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0032_add-cascade-delete-to-project_label.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0033_add-cascade-delete-to_task_label_project_label_id_fkey.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0034_add-cascade-delete-to_project_team_id_fkey.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0035_add-cascade-delete-to-task_assigned_user_id_fkey.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0036_add-fkey-to-user_id-on-refresh_token-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0037_add-project_member-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0038_add-role-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0039_add-role-column-to-user_account-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0040_add-unique-constraint-to-project_member-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0041_add-role_code-column-to-project_member-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0042_add-default-null-to-profile_avatar_url-on-user_account.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0043_add-role_code-column-to-team_member-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0044_add-owner-to-team-table.up.sql arch: move web folder into api & move api to top level 2020-07-04 18:08:37 -05:00
0045_add-system_options-table.up.sql feature: add first time install process 2020-07-16 19:40:23 -05:00
0046_add-system-user.up.sql feature: add first time install process 2020-07-16 19:40:23 -05:00
0047_add-default-label_colors.up.sql feature: add first time install process 2020-07-16 19:40:23 -05:00
0048_add-cascade-delete-to-task_group_project_id_fkey.up.sql feature: add first time install process 2020-07-16 19:40:23 -05:00
0049_remove-owner-column-from-project-table.up.sql feat: enforce user roles 2020-08-11 21:03:21 -05:00
0050_remove-owner-column-from-team-table.up.sql feat: enforce user roles 2020-08-11 21:03:21 -05:00