This commit is contained in:
Corban-Lee Jones 2024-03-23 23:31:25 +00:00
commit 5bea031f79
4 changed files with 38 additions and 6 deletions

23
apps/api/permissions.py Normal file
View 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

View File

@ -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

View File

@ -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 {

View File

@ -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; ">