-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add permissions to the invite link #258
Conversation
Code Climate has analyzed commit 0464e89 and detected 4 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 68.1% (-0.1% change). View more on Code Climate. |
enformce 1 required element in permCodes array prevent duplicate perms in array in db Require MANAGE permission to update a bucket update codeowners file
app/src/controllers/invite.js
Outdated
instance: req.originalUrl, | ||
bucketId: invite.resource | ||
// Grant invitation permission and cleanup | ||
await objectPermissionService.addPermissions(invite.resource, [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi, the objectPermissionService.addPermissions()
method can accept an array of { user,Id, permCode } objects.
eg:
await objectPermissionService.addPermissions(invite.resource, permCodes.map( p => { uswerID: userId, permCode.p }), invite.createdBy);
so maybe you dont need the forEach.. but again.. maybe it's clearer the way you have it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its a good point, i feel like we should redo this part of the code, may be along with BCBOX?
Description
Types of changes
Checklist
Further comments