1
0
Fork 0

chore: update ACLs

- Added permission to manage badges for user support (mainly to assign the donator badge)
- Added `channels/{fetch,create}/dm` for moderation, required for alerts
- Removed permission bypass for insert since it shouldn't be needed anymore
dufisgsd
Lea 2023-08-09 21:12:54 +02:00
parent 2522cfe6de
commit de305d3901
Signed by: lea
GPG Key ID: 1BAFFE8347019C42
1 changed files with 4 additions and 1 deletions

View File

@ -97,6 +97,7 @@ const PermissionSets = {
"users/fetch/by-id", "users/fetch/by-id",
"users/fetch/strikes", "users/fetch/strikes",
"users/fetch/notices", "users/fetch/notices",
"users/update/badges",
"accounts/fetch/by-id", "accounts/fetch/by-id",
"accounts/disable", "accounts/disable",
@ -118,6 +119,8 @@ const PermissionSets = {
"messages/fetch/by-id", "messages/fetch/by-id",
"channels/fetch/by-id", "channels/fetch/by-id",
"channels/fetch/dm",
"channels/create/dm",
"reports/fetch/related/by-user", "reports/fetch/related/by-user",
"reports/fetch/related/by-content", "reports/fetch/related/by-content",
@ -177,7 +180,7 @@ const ACL: Record<string, Set<Permission>> = {
}; };
function hasPermission(email: string, permission: Permission) { function hasPermission(email: string, permission: Permission) {
if (email === "insert@revolt.chat" || process.env.BYPASS_ACL) return true; if (process.env.BYPASS_ACL) return true;
if (!ACL[email]) throw `user is not registered in system: ${email}`; if (!ACL[email]) throw `user is not registered in system: ${email}`;
const segments = permission.split("/"); const segments = permission.split("/");