Merge branch 'main' of https://gitea.corbz.dev/corbz/PYRSS-Website
This commit is contained in:
commit
5bea031f79
23
apps/api/permissions.py
Normal file
23
apps/api/permissions.py
Normal file
@ -0,0 +1,23 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
|
||||
from rest_framework.permissions import BasePermission
|
||||
|
||||
|
||||
class UserHasDiscordPermissions(BasePermission):
|
||||
"""
|
||||
Permission to ensure that the user is permitted to make
|
||||
changes on behalf of the server they are representing.
|
||||
"""
|
||||
|
||||
|
||||
|
||||
|
||||
# class SubscriptionServerMember(BasePermission):
|
||||
# """
|
||||
# Permission for each subscription that omits the sub if
|
||||
# the request user isn't a member of it's server.
|
||||
# """
|
||||
|
||||
# def has_object_permission(self, request, view, obj):
|
||||
|
||||
# return obj.server in request.user.servers
|
@ -139,6 +139,9 @@ class UserServerLink(models.Model):
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
@property
|
||||
def is_admin(self):
|
||||
return self.perm_flags & 0x0000000000000008
|
||||
# @property
|
||||
# def is_admin(self):
|
||||
# return self.perm_flags & 0x0000000000000008
|
||||
|
||||
def has_permission(self, permission):
|
||||
return self.permissions & permission
|
||||
|
@ -16,6 +16,12 @@
|
||||
-webkit-box-shadow: none !important;
|
||||
font-size: 1rem !important;
|
||||
background-color: var(--bs-body-bg) !important;
|
||||
padding: 0.375rem 0.75rem !important;
|
||||
}
|
||||
|
||||
.select2-container--bootstrap .select2-selection--single {
|
||||
line-height: 1.5 !important;
|
||||
height: fit-content !important;
|
||||
}
|
||||
|
||||
.select2-selection__rendered {
|
||||
|
@ -198,14 +198,14 @@
|
||||
<!-- Specific Page JS goes HERE -->
|
||||
{% block javascripts %}
|
||||
<script id="subItemTemplate" type="text/template">
|
||||
<div class="col-md-4 col-xxl-3">
|
||||
<div class="col-md-6 col-lg-4 col-xxl-3">
|
||||
<div class="sub-item layers bd bg-body h-100 rounded-3" data-uuid="">
|
||||
<div class="layer w-100">
|
||||
<div class="peers px-4 py-3 flex-nowrap">
|
||||
<div class="peer peer-greed me-4">
|
||||
<div class="peer peer-greed me-4 text-wrap overflow-hidden">
|
||||
<h5 class="sub-name"></h5>
|
||||
<div class="sub-uuid mb-2"></div>
|
||||
<div class="sub-datetime"></div>
|
||||
<div class="d-flex sub-datetime"></div>
|
||||
</div>
|
||||
<div class="peer">
|
||||
<img src="" alt="" class="sub-img rounded-3" width="100" height="100" style="object-fit: cover; ">
|
||||
|
Loading…
x
Reference in New Issue
Block a user