Skip to content

Commit

Permalink
fix(authentication): team permissions allowance check
Browse files Browse the repository at this point in the history
  • Loading branch information
kkopanidis committed Apr 10, 2023
1 parent 35b706b commit 6cac5ba
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions modules/authentication/src/handlers/team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class TeamsHandler implements IAuthenticationStrategy {
actions: ['invite'],
resource: 'Team:' + teamId,
});
if (!allowed || !config.teams.allowAddWithoutInvite) {
if (!allowed.allow || !config.teams.allowAddWithoutInvite) {
throw new GrpcError(
status.INVALID_ARGUMENT,
'Could not add user to team, user does not have permission ' +
Expand Down Expand Up @@ -170,7 +170,7 @@ export class TeamsHandler implements IAuthenticationStrategy {
actions: ['edit'],
resource: 'Team:' + parentTeam,
});
if (!allowed) {
if (!allowed.allow) {
throw new GrpcError(
status.PERMISSION_DENIED,
'User does not have permission to create a subteam',
Expand Down Expand Up @@ -269,7 +269,7 @@ export class TeamsHandler implements IAuthenticationStrategy {
actions: ['edit'],
resource: 'Team:' + teamId,
});
if (!allowed) {
if (!allowed.allow) {
throw new GrpcError(
status.PERMISSION_DENIED,
'User does not have permission to remove team members',
Expand All @@ -295,7 +295,7 @@ export class TeamsHandler implements IAuthenticationStrategy {
actions: ['read'],
resource: 'Team:' + teamId,
});
if (!allowed) {
if (!allowed.allow) {
throw new GrpcError(
status.PERMISSION_DENIED,
'User does not have permission to view team members',
Expand Down Expand Up @@ -328,7 +328,7 @@ export class TeamsHandler implements IAuthenticationStrategy {
actions: ['read'],
resource: 'Team:' + teamId,
});
if (!allowed) {
if (!allowed.allow) {
throw new GrpcError(
status.PERMISSION_DENIED,
'User does not have permission to view team',
Expand Down Expand Up @@ -379,7 +379,7 @@ export class TeamsHandler implements IAuthenticationStrategy {
actions: ['read'],
resource: 'Team:' + teamId,
});
if (!allowed) {
if (!allowed.allow) {
throw new GrpcError(
status.PERMISSION_DENIED,
'User does not have permission to view subteams',
Expand Down Expand Up @@ -481,7 +481,7 @@ export class TeamsHandler implements IAuthenticationStrategy {
actions: ['edit'],
resource: 'Team:' + teamId,
});
if (!allowed) {
if (!allowed.allow) {
throw new GrpcError(
status.PERMISSION_DENIED,
'User does not have permission to modify team members',
Expand Down

0 comments on commit 6cac5ba

Please sign in to comment.