mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
dont allow self targeting for set-perms (#434)
Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
parent
e5e574625a
commit
f17232e0c1
1 changed files with 1 additions and 1 deletions
|
@ -126,7 +126,7 @@ export function initGuildsAPI(app: express.Express) {
|
|||
if (type !== ApiPermissionTypes.User) {
|
||||
return clientError(res, "Invalid type");
|
||||
}
|
||||
if (!isSnowflake(targetId)) {
|
||||
if (!isSnowflake(targetId) || targetId === req.user!.userId) {
|
||||
return clientError(res, "Invalid targetId");
|
||||
}
|
||||
const validPermissions = new Set(Object.values(ApiPermissions));
|
||||
|
|
Loading…
Add table
Reference in a new issue