Skip to content

Commit c547148

Browse files
authored
Merge pull request #4303 from FlowFuse/4284_hide-invite-member-button-for-users-without-permissions
Hide the invite member button for users that don't have access to a team or insufficient privileges
2 parents f18548a + 335b961 commit c547148

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

frontend/src/components/PageHeader.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ import { ref } from 'vue'
6666
import { mapGetters, mapState } from 'vuex'
6767
6868
import navigationMixin from '../mixins/Navigation.js'
69+
import permissionsMixin from '../mixins/Permissions.js'
6970
7071
import NavItem from './NavItem.vue'
7172
import NotificationsButton from './NotificationsButton.vue'
@@ -80,7 +81,7 @@ export default {
8081
}
8182
},
8283
emits: ['menu-toggle'],
83-
mixins: [navigationMixin],
84+
mixins: [navigationMixin, permissionsMixin],
8485
computed: {
8586
...mapState('account', ['user', 'team', 'teams']),
8687
...mapGetters('account', ['notifications']),
@@ -117,7 +118,7 @@ export default {
117118
].filter(option => option !== undefined)
118119
},
119120
showInviteButton () {
120-
return this.$route.name !== 'TeamMembers'
121+
return this.team && this.hasPermission('team:user:invite') && this.$route.name !== 'TeamMembers'
121122
}
122123
},
123124
watch: {

0 commit comments

Comments
 (0)