Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit f0ccf80

Browse files
Allow non admin users to bulk upload
1 parent 26590ce commit f0ccf80

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

src/consts.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,20 @@ const UserRoles = {
66
admin: 'Admin',
77
administrator: 'Administrator',
88
topcoderUser: 'Topcoder User',
9-
copilot: 'Copilot'
9+
copilot: 'Copilot',
10+
ubahn: 'u-bahn'
1011
}
1112
/**
1213
* all authenticated users.
1314
* @type {(string)[]}
1415
*/
15-
const AllAuthenticatedUsers = [UserRoles.admin, UserRoles.administrator, UserRoles.topcoderUser, UserRoles.copilot]
16+
const AllAuthenticatedUsers = [
17+
UserRoles.admin,
18+
UserRoles.administrator,
19+
UserRoles.topcoderUser,
20+
UserRoles.copilot,
21+
UserRoles.ubahn
22+
]
1623

1724
/**
1825
* all admin user

src/routes.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = {
2727
method: 'uploadEntity',
2828
upload: fileUpload.single('upload'),
2929
auth: 'jwt',
30-
access: constants.AllAuthenticatedUsers,
30+
access: constants.AdminUser,
3131
scopes: [constants.Scopes.CreateUpload, constants.Scopes.AllUpload]
3232
}
3333
},
@@ -36,14 +36,14 @@ module.exports = {
3636
controller: 'UploadController',
3737
method: 'getEntity',
3838
auth: 'jwt',
39-
access: constants.AllAuthenticatedUsers,
39+
access: constants.AdminUser,
4040
scopes: [constants.Scopes.GetUpload, constants.Scopes.AllUpload]
4141
},
4242
patch: {
4343
controller: 'UploadController',
4444
method: 'partiallyUpdate',
4545
auth: 'jwt',
46-
access: constants.AllAuthenticatedUsers,
46+
access: constants.AdminUser,
4747
scopes: [constants.Scopes.UpdateUpload, constants.Scopes.AllUpload]
4848
}
4949
},
@@ -62,7 +62,7 @@ module.exports = {
6262
controller: 'TemplateController',
6363
method: 'getEntity',
6464
auth: 'jwt',
65-
access: constants.AllAuthenticatedUsers,
65+
access: constants.AdminUser,
6666
scopes: [constants.Scopes.GetTemplate, constants.Scopes.AllTemplate]
6767
}
6868
},

0 commit comments

Comments
 (0)