rename APPS_MODERATE to APPS_MODERATION
parent
6e33531be3
commit
02d0e2043e
|
@ -185,7 +185,7 @@ PERMS = { # Minimum admin_level to perform action.
|
|||
'NOTIFICATIONS_MODMAIL': 3,
|
||||
'NOTIFICATIONS_SPECIFIC_WPD_COMMENTS': 1,
|
||||
'MESSAGE_BLOCKED_USERS': 1,
|
||||
'APPS_MODERATE': 3,
|
||||
'APPS_MODERATION': 3,
|
||||
'STREAMERS_MODERATION': 2,
|
||||
'UNKNOWN_ADMIN_LEVEL2_PERM1': 2,
|
||||
'UNKNOWN_ADMIN_LEVEL2_PERM2': 2,
|
||||
|
|
|
@ -83,7 +83,7 @@ def request_api_keys(v):
|
|||
|
||||
new_comment.top_comment_id = new_comment.id
|
||||
|
||||
for admin in g.db.query(User).filter(User.admin_level >= PERMS['APPS_MODERATE']).all():
|
||||
for admin in g.db.query(User).filter(User.admin_level >= PERMS['APPS_MODERATION']).all():
|
||||
notif = Notification(comment_id=new_comment.id, user_id=admin.id)
|
||||
g.db.add(notif)
|
||||
|
||||
|
@ -137,7 +137,7 @@ def edit_oauth_app(v, aid):
|
|||
|
||||
@app.post("/admin/app/approve/<aid>")
|
||||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@admin_level_required(PERMS['APPS_MODERATE'])
|
||||
@admin_level_required(PERMS['APPS_MODERATION'])
|
||||
def admin_app_approve(v, aid):
|
||||
|
||||
app = g.db.get(OauthApp, aid)
|
||||
|
@ -173,7 +173,7 @@ def admin_app_approve(v, aid):
|
|||
|
||||
@app.post("/admin/app/revoke/<aid>")
|
||||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@admin_level_required(PERMS['APPS_MODERATE'])
|
||||
@admin_level_required(PERMS['APPS_MODERATION'])
|
||||
def admin_app_revoke(v, aid):
|
||||
|
||||
app = g.db.get(OauthApp, aid)
|
||||
|
@ -198,7 +198,7 @@ def admin_app_revoke(v, aid):
|
|||
|
||||
@app.post("/admin/app/reject/<aid>")
|
||||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@admin_level_required(PERMS['APPS_MODERATE'])
|
||||
@admin_level_required(PERMS['APPS_MODERATION'])
|
||||
def admin_app_reject(v, aid):
|
||||
|
||||
app = g.db.get(OauthApp, aid)
|
||||
|
@ -223,7 +223,7 @@ def admin_app_reject(v, aid):
|
|||
|
||||
|
||||
@app.get("/admin/app/<aid>")
|
||||
@admin_level_required(PERMS['APPS_MODERATE'])
|
||||
@admin_level_required(PERMS['APPS_MODERATION'])
|
||||
def admin_app_id(v, aid):
|
||||
aid=aid
|
||||
oauth = g.db.get(OauthApp, aid)
|
||||
|
@ -244,7 +244,7 @@ def admin_app_id(v, aid):
|
|||
)
|
||||
|
||||
@app.get("/admin/app/<aid>/comments")
|
||||
@admin_level_required(PERMS['APPS_MODERATE'])
|
||||
@admin_level_required(PERMS['APPS_MODERATION'])
|
||||
def admin_app_id_comments(v, aid):
|
||||
|
||||
aid=aid
|
||||
|
@ -271,7 +271,7 @@ def admin_app_id_comments(v, aid):
|
|||
|
||||
|
||||
@app.get("/admin/apps")
|
||||
@admin_level_required(PERMS['APPS_MODERATE'])
|
||||
@admin_level_required(PERMS['APPS_MODERATION'])
|
||||
def admin_apps_list(v):
|
||||
|
||||
apps = g.db.query(OauthApp).order_by(OauthApp.id.desc()).all()
|
||||
|
|
|
@ -102,7 +102,7 @@
|
|||
{% if v.admin_level >= PERMS['HOLE_CREATE'] %}
|
||||
<li><a href="/create_hole">Create {{ HOLE_NAME | capitalize }}</a></li>
|
||||
{% endif %}
|
||||
{% if v.admin_level >= PERMS['APPS_MODERATE'] %}
|
||||
{% if v.admin_level >= PERMS['APPS_MODERATION'] %}
|
||||
<li><a href="/admin/apps">Apps</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
|
|
@ -490,7 +490,7 @@
|
|||
<button id="ban-{{c.id}}" class="dropdown-item list-inline-item d-none {% if not c.author.is_suspended %}d-md-block{% endif %} text-danger" data-bs-toggle="modal" data-bs-target="#banModal" onclick="banModal('/comment/{{c.id}}', '{{c.author.id}}', '{{c.author_name}}')"><i class="fas fa-user-slash text-danger fa-fw"></i>Ban user</button>
|
||||
{% endif %}
|
||||
|
||||
{% if v.admin_level >= PERMS['APPS_MODERATE'] and c.oauth_app %}
|
||||
{% if v.admin_level >= PERMS['APPS_MODERATION'] and c.oauth_app %}
|
||||
<a href="{{c.oauth_app.permalink}}/comments" class="dropdown-item list-inline-item d-none d-md-block text-primary"><i class="fas fa-code text-primary fa-fw"></i>API App</a>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
@ -721,7 +721,7 @@
|
|||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if c.oauth_app and v.admin_level >= PERMS['APPS_MODERATE'] %}
|
||||
{% if c.oauth_app and v.admin_level >= PERMS['APPS_MODERATION'] %}
|
||||
<a href="{{c.oauth_app.permalink}}/comments" class="list-group-item text-info"><i class="fas fa-code text-info mr-2"></i>API App</a>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<button id="approve2-{{p.id}}" class="{% if not p.is_banned %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-success text-left" role="button" onclick="post_toast(this,'/approve_post/{{p.id}}','remove2-{{p.id}}','approve2-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="far fa-check text-center mr-2"></i>Approve</button>
|
||||
{% endif %}
|
||||
|
||||
{% if p.oauth_app and v.admin_level >= PERMS['APPS_MODERATE'] %}
|
||||
{% if p.oauth_app and v.admin_level >= PERMS['APPS_MODERATION'] %}
|
||||
<a href="{{p.oauth_app.permalink}}"><button class="nobackground btn btn-link btn-block btn-lg text-muted text-left"><i class="far fa-code text-center text-info mr-2"></i>API App</button></a>
|
||||
{% endif %}
|
||||
|
||||
|
|
Loading…
Reference in New Issue