mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-05 21:24:46 +02:00

This patch enables a read-only REST API for the layerindex application using Django REST Framework. The objects of types Branch, LayerBranch and LayerItem are exposed to queries so that the layerindex application can function as a Layer Source in Toaster. The library dependencies are documented in the requirements.txt file. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
8 lines
239 B
Python
8 lines
239 B
Python
from rest_framework import permissions
|
|
|
|
class ReadOnlyPermission(permissions.BasePermission):
|
|
def has_permission(self, request, view):
|
|
if request.method in permissions.SAFE_METHODS:
|
|
return True
|
|
return False
|