Fix accessing group profile when not member

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-03-16 17:36:30 +01:00
parent 27a1d92e52
commit 28bfc31b01
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -84,7 +84,10 @@ export default class GroupMixin extends Vue {
hasCurrentActorThisRole(givenRole: string | string[]): boolean {
const roles = Array.isArray(givenRole) ? givenRole : [givenRole];
return roles.includes(this.person?.memberships?.elements[0].role);
return (
this.person?.memberships?.total > 0 &&
roles.includes(this.person?.memberships?.elements[0].role)
);
}
handleErrors(errors: any[]): void {