We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bfdb84c commit f06ebc8Copy full SHA for f06ebc8
app/manage/permissions/view-org-team-keys.js
@@ -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