Skip to content

Commit f06ebc8

Browse files
committed
change permission for orgTeamAttributes call
1 parent bfdb84c commit f06ebc8

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const { isOwner, isOrgTeamModerator } = require('../../lib/organization')
2+
3+
/**
4+
* organization:view-team-keys
5+
*
6+
* To edit an organization or delete it, the authenticated user needs
7+
* to be an owner in the organization
8+
*
9+
* @param {int} uid - user id
10+
* @param {Object} params - request parameters
11+
* @param {int} params.id - organization id
12+
* @returns {Promise<boolean>}
13+
*/
14+
async function editOrg (uid, { id }) {
15+
const teamModerator = await isOrgTeamModerator(id, uid)
16+
return teamModerator || isOwner(id, uid)
17+
}
18+
19+
module.exports = editOrg

0 commit comments

Comments
 (0)