mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 16:28:01 -05:00
account: Add employee property.
This commit is contained in:
@@ -174,6 +174,7 @@ class Globals(object):
|
||||
'cassandra_seeds',
|
||||
'admins',
|
||||
'sponsors',
|
||||
'employees',
|
||||
'automatic_reddits',
|
||||
'allowed_css_linked_domains',
|
||||
'authorized_cnames',
|
||||
|
||||
@@ -630,6 +630,17 @@ class Account(Thing):
|
||||
'''
|
||||
return setattr(self, 'received_trophy_%s' % uid, trophy_id)
|
||||
|
||||
@property
|
||||
def employee(self):
|
||||
"""Return if the user is an employee.
|
||||
|
||||
Being an employee grants them various special privileges.
|
||||
|
||||
"""
|
||||
return (self.name in g.admins or
|
||||
self.name in g.sponsors or
|
||||
self.name in g.employees)
|
||||
|
||||
class FakeAccount(Account):
|
||||
_nodb = True
|
||||
pref_no_profanity = True
|
||||
|
||||
Reference in New Issue
Block a user