layerindex-web/layerindex/restperm.py
Alexandru DAMIAN 1c9d6be527 expose REST API for layerindex
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>
2014-09-24 11:32:34 +01:00

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