aboutsummaryrefslogtreecommitdiff
path: root/src/components/moderation_tools/moderation_tools.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/moderation_tools/moderation_tools.js')
-rw-r--r--src/components/moderation_tools/moderation_tools.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/components/moderation_tools/moderation_tools.js b/src/components/moderation_tools/moderation_tools.js
index 2469327a..a5ce8656 100644
--- a/src/components/moderation_tools/moderation_tools.js
+++ b/src/components/moderation_tools/moderation_tools.js
@@ -41,14 +41,26 @@ const ModerationTools = {
tagsSet () {
return new Set(this.user.tags)
},
- hasTagPolicy () {
- return this.$store.state.instance.tagPolicyAvailable
+ canGrantRole () {
+ return this.user.is_local && !this.user.deactivated && this.$store.state.users.currentUser.role === 'admin'
+ },
+ canChangeActivationState () {
+ return this.privileged('users_manage_activation_state')
+ },
+ canDeleteAccount () {
+ return this.privileged('users_delete')
+ },
+ canUseTagPolicy () {
+ return this.$store.state.instance.tagPolicyAvailable && this.privileged('users_manage_tags')
}
},
methods: {
hasTag (tagName) {
return this.tagsSet.has(tagName)
},
+ privileged (privilege) {
+ return this.$store.state.users.currentUser.privileges.includes(privilege)
+ },
toggleTag (tag) {
const store = this.$store
if (this.tagsSet.has(tag)) {