fix: remove MANAGE_INVITES (overflow)
This commit is contained in:
parent
dc74c5d63c
commit
69fc3ca490
3 changed files with 3 additions and 5 deletions
|
@ -258,7 +258,6 @@
|
|||
MANAGE_APPS: 1 << 28,
|
||||
MANAGE_JOURNALS: 1 << 29,
|
||||
MANAGE_NOTES: 1 << 30,
|
||||
MANAGE_INVITES: 1 << 31,
|
||||
},
|
||||
],
|
||||
);
|
||||
|
|
|
@ -97,8 +97,8 @@ impl DataManager {
|
|||
.to_string(),
|
||||
));
|
||||
}
|
||||
} else if !user.permissions.check(FinePermission::MANAGE_INVITES) {
|
||||
// check count
|
||||
} else if !user.permissions.check(FinePermission::MANAGE_USERS) {
|
||||
// check count since we're also not a moderator with MANAGE_USERS
|
||||
if self.get_invite_codes_by_owner(user.id).await?.len()
|
||||
>= Self::MAXIMUM_SUPPORTER_INVITE_CODES
|
||||
{
|
||||
|
@ -134,7 +134,7 @@ impl DataManager {
|
|||
}
|
||||
|
||||
pub async fn delete_invite_code(&self, id: usize, user: &User) -> Result<()> {
|
||||
if !user.permissions.check(FinePermission::MANAGE_INVITES) {
|
||||
if !user.permissions.check(FinePermission::MANAGE_USERS) {
|
||||
return Err(Error::NotAllowed);
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,6 @@ bitflags! {
|
|||
const MANAGE_APPS = 1 << 28;
|
||||
const MANAGE_JOURNALS = 1 << 29;
|
||||
const MANAGE_NOTES = 1 << 30;
|
||||
const MANAGE_INVITES = 1 << 31;
|
||||
|
||||
const _ = !0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue