mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
add User.is_trusted_user() and User.is_developer()
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
ef4a7308ee
commit
d606ebc0f1
2 changed files with 45 additions and 1 deletions
|
@ -156,6 +156,18 @@ class User(Base):
|
|||
session.delete(self.session)
|
||||
session.commit()
|
||||
|
||||
def is_trusted_user(self):
|
||||
return self.AccountType.ID in {
|
||||
aurweb.models.account_type.TRUSTED_USER_ID,
|
||||
aurweb.models.account_type.TRUSTED_USER_AND_DEV_ID
|
||||
}
|
||||
|
||||
def is_developer(self):
|
||||
return self.AccountType.ID in {
|
||||
aurweb.models.account_type.DEVELOPER_ID,
|
||||
aurweb.models.account_type.TRUSTED_USER_AND_DEV_ID
|
||||
}
|
||||
|
||||
def __repr__(self):
|
||||
return "<User(ID='%s', AccountType='%s', Username='%s')>" % (
|
||||
self.ID, str(self.AccountType), self.Username)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue