Exemple #1
0
    def get(self, request, file_mgr_name, system_id, file_path):
        if file_mgr_name == AgaveFileManager.NAME \
            or file_mgr_name == 'public':
            if not request.user.is_authenticated:
                return HttpResponseForbidden('Login required')

            # List permissions as the portal user rather than logged in user.
            # This also works around the issue where pems on private systems are
            # inconsistent.
            fm = AgaveFileManager(agave_client=get_service_account_client())
            pems = fm.list_permissions(system_id, file_path)
            return JsonResponse(pems, encoder=AgaveJSONEncoder, safe=False)

        return HttpResponseBadRequest("Unsupported operation.")
Exemple #2
0
    def get(self, request, file_mgr_name, system_id, file_path):
        if file_mgr_name == AgaveFileManager.NAME \
            or file_mgr_name == 'public':
            if not request.user.is_authenticated():
                return HttpResponseForbidden('Log in required')

            # List permissions as the portal user rather than logged in user.
            # This also works around the issue where pems on private systems are
            # inconsistent.
            fm = AgaveFileManager(agave_client=get_service_account_client())
            pems = fm.list_permissions(system_id, file_path)
            return JsonResponse(pems, encoder=AgaveJSONEncoder, safe=False)

        return HttpResponseBadRequest("Unsupported operation")