Simplify environment role updates in app settings.
Use ApplicationRole.id instead of User.id in forms. This eliminates the need for the function that checks whether a user is in a given application, because looking up the application role will raise an error if the user is not.
This commit is contained in:
@@ -57,7 +57,7 @@ export const EditEnvironmentRole = {
|
||||
getUserInfo: function(userId) {
|
||||
for (let role of this.roleCategories) {
|
||||
for (let member of role.members) {
|
||||
if (member.user_id === userId) {
|
||||
if (member.application_role_id === userId) {
|
||||
return member
|
||||
}
|
||||
}
|
||||
@@ -67,7 +67,7 @@ export const EditEnvironmentRole = {
|
||||
removeUser: function(userId) {
|
||||
for (let role of this.roleCategories) {
|
||||
role.members = role.members.filter(member => {
|
||||
return member.user_id !== userId
|
||||
return member.application_role_id !== userId
|
||||
})
|
||||
if (!role.members) {
|
||||
role.members = []
|
||||
|
Reference in New Issue
Block a user