Skip to content

Commit

Permalink
Allow to edit admin user
Browse files Browse the repository at this point in the history
Signed-off-by: GretaD <gretadoci@gmail.com>
  • Loading branch information
GretaD authored and kesselb committed Apr 15, 2020
1 parent 95ad9ab commit 262c051
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 101 deletions.
89 changes: 0 additions & 89 deletions apps/settings/js/vue-4.js

This file was deleted.

1 change: 0 additions & 1 deletion apps/settings/js/vue-4.js.map

This file was deleted.

6 changes: 3 additions & 3 deletions apps/settings/js/vue-6.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/settings/js/vue-6.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/settings/js/vue-settings-apps-users-management.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/settings/js/vue-settings-apps-users-management.js.map

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions apps/settings/src/components/UserList/UserRowSimple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</div>

<div class="userActions">
<div v-if="canEdit && !loading.all" class="toggleUserActions">
<div v-if="canEditUser(user) && !loading.all" class="toggleUserActions">
<Actions>
<ActionButton icon="icon-rename" @click="toggleEdit">
{{ t('settings', 'Edit User') }}
Expand All @@ -82,7 +82,6 @@
<script>
import { PopoverMenu, Actions, ActionButton } from '@nextcloud/vue'
import ClickOutside from 'vue-click-outside'
import { getCurrentUser } from '@nextcloud/auth'
import UserRowMixin from '../../mixins/UserRowMixin'
export default {
Expand Down Expand Up @@ -147,8 +146,8 @@ export default {
}
return t('settings', '{size} used', { size: OC.Util.humanFileSize(0) })
},
canEdit() {
return getCurrentUser().uid !== this.user.id && this.user.id !== 'admin'
canEditUser() {
return (user) => this.settings.isAdmin || user.id !== OC.getCurrentUser().uid
},
userQuota() {
if (this.user.quota.quota === 'none') {
Expand Down

0 comments on commit 262c051

Please sign in to comment.