diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/components/MemberList.vue | 4 | ||||
-rw-r--r-- | src/components/MembersList/MembersListItem.vue | 13 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/components/MemberList.vue b/src/components/MemberList.vue index 55652ec3..0c311378 100644 --- a/src/components/MemberList.vue +++ b/src/components/MemberList.vue @@ -35,7 +35,9 @@ <AppContentList v-else :class="{ 'icon-loading': loading, showdetails: showDetails }"> <div class="members-list__new"> - <button class="icon-add" @click="onShowPicker(circle.id)"> + <button v-if="circle.canManageMembers" + class="icon-add" + @click="onShowPicker(circle.id)"> {{ t('contacts', 'Add members') }} </button> <button v-if="isMobile" diff --git a/src/components/MembersList/MembersListItem.vue b/src/components/MembersList/MembersListItem.vue index 3774b3c7..b90ee0b8 100644 --- a/src/components/MembersList/MembersListItem.vue +++ b/src/components/MembersList/MembersListItem.vue @@ -162,16 +162,21 @@ export default { const levels = Object.keys(CIRCLES_MEMBER_LEVELS) // Object.keys returns those as string .map(level => parseInt(level, 10)) - // we cannot set to a level higher than the current user's level + // we cannot set to a level higher or equal than the current user's level .filter(level => level < this.currentUserLevel) - // we cannot set to the level this member is already - .filter(level => level !== this.source.level) + // Admins can promote others as Admin too + if (this.currentUserLevel === MemberLevels.ADMIN) { + levels.push(MemberLevels.ADMIN) + } + + // Owners transfer ownership to another member if (this.circle.isOwner) { levels.push(MemberLevels.OWNER) } - return levels + // we cannot set to the level this member is already + return levels.filter(level => level !== this.source.level) }, /** |