feat: implement LMS core (CMS, Courses, Enrollment, Progress, Auth) (Admin + API)
Build & Push Docker Image (Backend) / build (push) Successful in 54s

This commit is contained in:
Flook
2026-05-03 09:36:47 +07:00
parent 1ec6fa68a1
commit fe67d491e2
25 changed files with 590 additions and 71 deletions
+12
View File
@@ -0,0 +1,12 @@
from rest_framework.permissions import BasePermission, SAFE_METHODS
class IsStaffOrReadOnly(BasePermission):
"""
- อ่านได้ทุกคน
- เขียนได้เฉพาะ staff
"""
def has_permission(self, request, view):
if request.method in SAFE_METHODS:
return True
return request.user and request.user.is_staff