示例#1
0
 class Meta:
     resource_name = 'scope'
     queryset = Scope.objects.all()
     authentication = OAuth2Authentication("funf_write")
     authorization = PDSAuthorization(scope="funf_write",
                                      audit_enabled=True)
     filtering = {"datastore_owner": ALL_WITH_RELATIONS}
示例#2
0
 class Meta:
     resource_name = "funfconfig"
     list_allowed_methods = ["delete", "get", "post"]
     authentication = OAuth2Authentication("funf_write")
     authorization = PDSAuthorization(scope="funf_write",
                                      audit_enabled=True)
     object_class = Document
     collection = "funfconfig"  # collection name
示例#3
0
 class Meta:
     queryset = Device.objects.all()
     allowed_methods = ("get", "post", "delete")
     authentication = OAuth2Authentication("funf_write")
     authorization = PDSAuthorization(scope="funf_write",
                                      audit_enabled=True)
     filtering = {"datastore_owner": ALL_WITH_RELATIONS}
     limit = 20
示例#4
0
 class Meta:
     resource_name = 'role'
     queryset = Role.objects.all()
     list_allowed_methods = ["delete", "get", "post"]
     authentication = OAuth2Authentication("funf_write")
     authorization = PDSAuthorization(scope="funf_write",
                                      audit_enabled=True)
     filtering = {"datastore_owner": ALL_WITH_RELATIONS}
示例#5
0
 class Meta:
     resource_name = "answer"
     list_allowed_methods = ["delete", "get", "post"]
     help_text = 'resource help text...'
     authentication = OAuth2Authentication("funf_write")
     authorization = PDSAuthorization(scope="funf_write",
                                      audit_enabled=True)
     object_class = Document
     collection = "answer"  # collection name
示例#6
0
 class Meta:
     authentication = OAuth2Authentication("funf_write")
     authorization = PDSAuthorization(scope="funf_write",
                                      audit_enabled=True)
     resource_name = "funf"
     list_allowed_methods = ["delete", "get", "post"]
     object_class = Document
     collection = "funf"  # collection name
     filtering = {"key": ["exact"]}
示例#7
0
 class Meta:
     authentication = OAuth2Authentication("crowdsos_write")
     authorization = PDSAuthorization(scope="crowdsos_write",
                                      audit_enabled=False)
     resource_name = "incident"
     list_allowed_methods = ["delete", "get", "post"]
     object_class = Document
     collection = "incident"
     filtering = {"type": ["exact"]}
示例#8
0
 class Meta:
     queryset = AuditEntry.objects.extra({
         'date': 'date(timestamp)'
     }).values('date').annotate(count=models.Count("id"))
     authentication = OAuth2Authentication("funf_write")
     authorization = PDSAuthorization(scope="funf_write",
                                      audit_enabled=False)
     fields = ['date', 'count']
     allowed_methods = ('get')
     filtering = {
         "date": ["gte", "lte", "gt", "lt"],
         "datastore_owner": ALL_WITH_RELATIONS
     }
     ordering = ("date")
示例#9
0
 class Meta:
     queryset = AuditEntry.objects.all()
     # POST is provided to allow a Resource or Sandbox server to store audit entries on the PDS
     allowed_methods = ('get', 'post')
     authentication = OAuth2Authentication("funf_write")
     authorization = PDSAuthorization(scope="funf_write",
                                      audit_enabled=False)
     filtering = {
         "datastore_owner": ALL_WITH_RELATIONS,
         "timestamp": ["gte", "lte", "gt", "lt"],
         "script": ["contains"],
         "requester": ALL_WITH_RELATIONS
     }
     ordering = ('timestamp')
     limit = 20
示例#10
0
 class Meta:
     queryset = Profile.objects.all()
     authentication = OAuth2Authentication("funf_write")
     authorization = PDSAuthorization(scope="funf_write",
                                      audit_enabled=True)
     filtering = {"uuid": ["contains", "exact"]}