Skip to content

Commit

Permalink
fix(core): restrict master actions page to the master account only
Browse files Browse the repository at this point in the history
Previously, admins with all_permissions used to be able to.
The same also applies to setup and deployer pages, but that's not much
of a problem.
  • Loading branch information
tabarra committed Jun 9, 2023
1 parent 353ddc2 commit c21a714
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions core/components/WebServer/ctxUtils.js
Expand Up @@ -171,6 +171,9 @@ function logAction(ctx, action) {
function hasPermission(ctx, perm) {
try {
const sess = ctx.nuiSession ?? ctx.session;
if (perm === 'master') {
return sess.auth.master === true;
}
return (
sess.auth.master === true
|| sess.auth.permissions.includes('all_permissions')
Expand Down
4 changes: 2 additions & 2 deletions docs/dev_notes.md
Expand Up @@ -2,8 +2,8 @@
- [ ] downgrade discord.js to v14.7.1
- [ ] improve timeout handling of discord bot save
- [ ] improve the bot with dangerous permissions message
- [ ] xxxxx
- [ ] xxxxx
- [ ] update libs
- [ ] merge PRs
- [ ] disable whitelist page when server is not on license whitelist mode

> next up
Expand Down

0 comments on commit c21a714

Please sign in to comment.