refactor(server scopes): use constants for apps write scope

This commit is contained in:
Gergő Jedlicska
2023-07-26 13:48:20 +02:00
parent 4a8fc08434
commit 9e52fa934e
4 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ module.exports = [
public: false
},
{
name: 'apps:write',
name: Scopes.Apps.Write,
description: 'Register applications on your behalf.',
public: false
}
@@ -36,7 +36,7 @@ describe('GraphQL @apps-api', () => {
testToken = `Bearer ${await createPersonalAccessToken(testUser.id, 'test token', [
Scopes.Profile.Read,
Scopes.Apps.Read,
'apps:write'
Scopes.Apps.Write
])}`
testUser2 = {
@@ -49,7 +49,7 @@ describe('GraphQL @apps-api', () => {
testToken2 = `Bearer ${await createPersonalAccessToken(testUser2.id, 'test token', [
Scopes.Profile.Read,
Scopes.Apps.Read,
'apps:write'
Scopes.Apps.Write
])}`
})
@@ -1702,7 +1702,7 @@ describe('GraphQL API Core @core-api', () => {
Scopes.Profile.Read,
Scopes.Profile.Email,
Scopes.Apps.Read,
'apps:write',
Scopes.Apps.Write,
'users:invite'
]
)}`
+2 -1
View File
@@ -49,7 +49,8 @@ export const Scopes = Object.freeze(<const>{
Write: 'tokens:write'
},
Apps: {
Read: 'apps:read'
Read: 'apps:read',
Write: 'apps:write'
}
})