-
Notifications
You must be signed in to change notification settings - Fork 7
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
[Debt] Update how roles are set as part of communities changes #10791
Changes from 5 commits
7e2d841
7c660bb
b1fbe03
7f03c47
a17b338
4d92c26
dcceb4d
1d80d07
174582c
6187473
4980080
b909155
6cd2094
c5522c1
3af0b17
fc1e51b
ef143ea
d7214cf
24350ae
77159ef
9768145
0812f65
42c5e49
5515299
3524d65
a5f8521
423d590
f808353
de7a408
b9787c1
e4beaf0
83c6f35
819b41a
0f8c697
9edb149
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1679,7 +1679,6 @@ input RolesInput | |
input RoleAssignmentHasMany { | ||
attach: RolesInput | ||
detach: RolesInput | ||
sync: RolesInput | ||
} | ||
tristan-orourke marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# This input only accepts Team-Based roles. It is assumed that a team id will be provided at a higher level of input. | ||
|
@@ -1793,7 +1792,7 @@ type Mutation { | |
updateUserRolesInput: UpdateUserRolesInput! @spread | ||
): UserAuthInfo | ||
@update(model: "User") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we change the UpdateUserRolesInput, we'll need to remove the |
||
@canModel(ability: "updateRoles", model: "User") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should also add a @guard directive There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure b909155 |
||
@canModel(ability: "updateRoles", model: "User", injectArgs: true) | ||
deleteUser(id: ID! @whereKey): User | ||
@delete | ||
@guard | ||
|
@@ -2110,7 +2109,10 @@ type Mutation { | |
@canFind(ability: "delete", find: "id") | ||
updateUserTeamRoles( | ||
teamRoleAssignments: UpdateUserTeamRolesInput! @spread | ||
): Team @guard @canFind(ability: "assignTeamMembers", find: "teamId") | ||
): Team | ||
@guard | ||
@canFind(ability: "assignTeamMembers", find: "teamId") | ||
@deprecated(reason: "use updateUserRoles") | ||
|
||
# Notifications | ||
markNotificationAsRead(id: UUID!): Notification @guard # can only affect notifications belonging to the logged-in user | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I take back my previous comment about decoupling this policy from the schema. However, if we follow my suggested change to the schema, then it probably makes more sense to simply loop through all the attach roles then all the detach roles, instead of dealing with team roles first then non-team roles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjusting the policy to fit the new mutation input type simplifies the policy file a fair bit
4980080