Skip to content

Commit

Permalink
fix: Remove possibility to change admin user roles
Browse files Browse the repository at this point in the history
  • Loading branch information
0live committed Jan 5, 2025
1 parent 7485aec commit adfa9b6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion vue/src/views/admin/components/AdminMembers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
density="comfortable"
icon="mdi-pencil-outline"
@click="editUser(item as User)"
:disabled="(item as User).roles.includes(UserRoles.ADMIN)"
class="disabled-white"
></v-btn>
</template>
</template>
Expand Down Expand Up @@ -128,11 +130,17 @@ const filteredItems = computed(() => {
})
const getRoleIconColor = (user: User, role: UserRoles) => {
if (user.roles.includes(role)) {
if (user.roles.includes(role) || user.roles.includes(UserRoles.ADMIN)) {
return 'main-green'
} else if (user.requestedRoles?.includes(role)) {
return 'main-red'
}
return 'main-grey'
}
</script>

<style scoped>
.disabled-white.v-btn--disabled {
color: white;
}
</style>

0 comments on commit adfa9b6

Please sign in to comment.