forked from MarseyWorld/MarseyWorld
some admin perms and also fix search
parent
20bd38b5d3
commit
1220d06eab
|
@ -136,6 +136,7 @@ PERMS = { # Minimum admin_level to perform action.
|
|||
'USER_SHADOWBAN': 2,
|
||||
'USER_AGENDAPOSTER': 2,
|
||||
'USER_CLUB_ALLOW_BAN': 2,
|
||||
'USER_LINK': 2,
|
||||
'POST_TO_CHANGELOG': 1,
|
||||
'POST_TO_POLL_THREAD': 2,
|
||||
'POST_BETS': 3,
|
||||
|
@ -158,6 +159,8 @@ PERMS = { # Minimum admin_level to perform action.
|
|||
'VIEW_SORTED_ADMIN_LIST': 3,
|
||||
'PRINT_MARSEYBUX_FOR_KIPPY_ON_PCMEMES': 3,
|
||||
'VIEW_ACTIVE_USERS': 2,
|
||||
'VIEW_ALL_USERS': 2,
|
||||
'VIEW_ALT_VOTES': 2,
|
||||
'MERGE_USERS': 3, # note: extra check for Aevann
|
||||
'ADMIN_ADD': 3, # note: explicitly disabled on rDrama
|
||||
'ADMIN_REMOVE': 3,
|
||||
|
|
|
@ -626,7 +626,7 @@ def badge_remove_post(v):
|
|||
|
||||
|
||||
@app.get("/admin/users")
|
||||
@admin_level_required(2)
|
||||
@admin_level_required(PERMS['VIEW_ALL_USERS'])
|
||||
def users_list(v):
|
||||
|
||||
try: page = int(request.values.get("page", 1))
|
||||
|
@ -647,7 +647,7 @@ def users_list(v):
|
|||
|
||||
|
||||
@app.get("/admin/alt_votes")
|
||||
@admin_level_required(2)
|
||||
@admin_level_required(PERMS['VIEW_ALT_VOTES'])
|
||||
def alt_votes_get(v):
|
||||
|
||||
u1 = request.values.get("u1")
|
||||
|
@ -754,7 +754,7 @@ def alt_votes_get(v):
|
|||
|
||||
@app.post("/admin/link_accounts")
|
||||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@admin_level_required(2)
|
||||
@admin_level_required(PERMS['USER_LINK'])
|
||||
def admin_link_accounts(v):
|
||||
|
||||
u1 = int(request.values.get("u1"))
|
||||
|
|
|
@ -61,12 +61,14 @@ def searchposts(v):
|
|||
if not v.paid_dues:
|
||||
posts = posts.filter(Submission.club == False)
|
||||
|
||||
if v.admin_level < 2:
|
||||
if v.admin_level < PERMS['POST_COMMENT_MODERATION']:
|
||||
posts = posts.filter(
|
||||
Submission.deleted_utc == 0,
|
||||
Submission.is_banned == False,
|
||||
Submission.private == False,
|
||||
User.shadowbanned == None)
|
||||
Submission.private == False)
|
||||
|
||||
if v.admin_level < PERMS['USER_SHADOWBAN']:
|
||||
posts = posts.filter(User.shadowbanned == None)
|
||||
|
||||
if 'author' in criteria:
|
||||
posts = posts.filter(Submission.ghost == False)
|
||||
|
|
Loading…
Reference in New Issue