{{ opt.label }}
+ >{{ opt.label }}
+
diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json
index b6eb66aaf..8f2eaddae 100644
--- a/src/i18n/langs/en.json
+++ b/src/i18n/langs/en.json
@@ -2116,7 +2116,8 @@
"passwordWillExpiredPrefixMsg": "The password will expire in ",
"passwordWillExpiredSuffixMsg": " days.Please change your password as soon as possible.",
"dateLastLogin": "Date last login",
- "AddAllMembersWarningMsg": "Are you sure you want to add all members?"
+ "AddAllMembersWarningMsg": "Are you sure you want to add all members?",
+ "disallowSelfUpdateFields": "Not allowed to modify the current fields oneself"
},
"notifications": {
"MessageType": "Message Type",
diff --git a/src/i18n/langs/ja.json b/src/i18n/langs/ja.json
index 2095a291a..bfe341f78 100644
--- a/src/i18n/langs/ja.json
+++ b/src/i18n/langs/ja.json
@@ -2105,7 +2105,8 @@
"passwordExpired": "パスワードが期限切れです",
"passwordWillExpiredPrefixMsg": "パスワードはまもなく",
"passwordWillExpiredSuffixMsg": "期限が切れた後、できるだけ早くパスワードを変更してください。",
- "AddAllMembersWarningMsg": "すべてのメンバーを追加してもよろしいですか?"
+ "AddAllMembersWarningMsg": "すべてのメンバーを追加してもよろしいですか?",
+ "disallowSelfUpdateFields": "現在のフィールドを自分で変更することは許可されていません"
},
"notifications": {
"MessageType": "メッセージタイプ",
diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json
index 96ec6c6bd..a16afb5d0 100644
--- a/src/i18n/langs/zh.json
+++ b/src/i18n/langs/zh.json
@@ -2099,7 +2099,8 @@
"SetPublicKey": "设置SSH公钥",
"passwordExpired": "密码过期了",
"passwordWillExpiredPrefixMsg": "密码即将在 ",
- "passwordWillExpiredSuffixMsg": "天 后过期,请尽快修改您的密码。"
+ "passwordWillExpiredSuffixMsg": "天 后过期,请尽快修改您的密码。",
+ "disallowSelfUpdateFields": "不允许自己修改当前字段"
},
"notifications": {
"MessageType": "消息类型",
diff --git a/src/views/users/User/UserCreateUpdate.vue b/src/views/users/User/UserCreateUpdate.vue
index d6f987313..88a830431 100644
--- a/src/views/users/User/UserCreateUpdate.vue
+++ b/src/views/users/User/UserCreateUpdate.vue
@@ -133,6 +133,7 @@ export default {
},
org_roles: {
component: Select2,
+ label: this.$t('users.OrgRoles'),
rules: this.$store.getters.currentOrgIsRoot ? [] : [rules.RequiredChange],
el: {
multiple: true,
@@ -164,6 +165,10 @@ export default {
},
phone: {
component: PhoneInput
+ },
+ is_active: {
+ label: this.$t('users.IsActive'),
+ el: {}
}
},
submitMethod() {
@@ -200,7 +205,7 @@ export default {
}
},
computed: {
- ...mapGetters(['currentOrgIsRoot'])
+ ...mapGetters(['currentOrgIsRoot', 'currentUser'])
},
async mounted() {
if (this.currentOrgIsRoot) {
@@ -212,6 +217,14 @@ export default {
methods: {
afterGetUser(user) {
this.user = user
+ if (this.user.id === this.currentUser.id) {
+ const fieldsToUpdate = ['system_roles', 'org_roles', 'is_active']
+ fieldsToUpdate.forEach(field => {
+ const msg = this.$t('users.disallowSelfUpdateFields', { attr: this.fieldsMeta[field]['label'] })
+ this.fieldsMeta[field].el.disabled = true
+ this.fieldsMeta[field].helpTips = msg
+ })
+ }
this.fieldsMeta.password.el.userIsOrgAdmin = user['is_org_admin']
if (this.$route.query.clone_from) {
this.user.groups = []