Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete group member behaviour #40

Open
sharathkumaranbu opened this issue Dec 11, 2019 · 1 comment
Open

Delete group member behaviour #40

sharathkumaranbu opened this issue Dec 11, 2019 · 1 comment

Comments

@sharathkumaranbu
Copy link
Collaborator

Right now we allow only Admins to access delete group member end point

groups-api/src/routes.js

Lines 86 to 93 in 7475dde

delete: {
controller: 'GroupMembershipController',
method: 'deleteGroupMember',
auth: 'jwt',
access: [constants.UserRoles.Admin],
scopes: ['write:groups', 'all:groups']
}
},

But in the code we have logic in place to allow a member to delete himself from self registration enabled groups.

if (
currentUser !== 'M2M' &&
!helper.hasAdminRole(currentUser) &&
!(group.selfRegister && currentUser.userId === memberId)
) {
throw new errors.ForbiddenError('You are not allowed to perform this action!')
}

What is the expected behaviour here @cwdcwd @dushyantb ?

@lakshmiathreya
Copy link

cc @lakshmiathreya

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants