diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2022-11-21 19:23:41 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2022-11-21 19:23:41 +0000 |
| commit | 8a87d82b7baf6cd8c4d1f33ee04d9fa1a25ae825 (patch) | |
| tree | 64726778724e1f6bbcad76dddd8bdda443e73714 /src/components/moderation_tools/moderation_tools.js | |
| parent | 6263ad7571b82ed7333a831a69a59c4192455b1d (diff) | |
| parent | 131d310703c568c9b5900587d049a8b5dd9477d8 (diff) | |
Merge branch 'fine_grained_moderation_privileges' into 'develop'
Add privileges
Closes #1177
See merge request pleroma/pleroma-fe!1583
Diffstat (limited to 'src/components/moderation_tools/moderation_tools.js')
| -rw-r--r-- | src/components/moderation_tools/moderation_tools.js | 16 |
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)) { |
