コード例 #1
0
ファイル: api.py プロジェクト: flyun/zamboni
 class Meta(MarketplaceModelResource.Meta):
     authentication = (SharedSecretAuthentication(), OAuthAuthentication())
     authorization = OwnerAuthorization()
     detail_allowed_methods = ['get', 'patch', 'put']
     fields = ['display_name']
     list_allowed_methods = []
     queryset = UserProfile.objects.filter()
     resource_name = 'settings'
コード例 #2
0
 class Meta(MarketplaceResource.Meta):
     always_return_data = True
     authentication = OAuthAuthentication()
     authorization = Authorization()
     detail_allowed_methods = []
     list_allowed_methods = ['post']
     object_class = dict
     resource_name = 'install'
コード例 #3
0
 class Meta(MarketplaceModelResource.Meta):
     authentication = (SharedSecretAuthentication(), OAuthAuthentication())
     authorization = OwnerAuthorization()
     detail_allowed_methods = ['get']
     list_allowed_methods = []
     fields = ['resource_uri']
     queryset = UserProfile.objects.filter()
     resource_name = 'permissions'
コード例 #4
0
ファイル: api.py プロジェクト: at13/zamboni
 class Meta(MarketplaceModelResource.Meta):
     validation = BangoFormValidation()
     queryset = PaymentAccount.objects.all()
     list_allowed_methods = ['get', 'post']
     detail_allowed_methods = ['get', 'put', 'delete']
     authentication = OAuthAuthentication()
     authorization = Authorization()
     resource_name = 'account'
コード例 #5
0
ファイル: resources.py プロジェクト: zzdjk6/zamboni
 class Meta(MarketplaceResource.Meta):
     always_return_data = True
     authentication = (SharedSecretAuthentication(), OAuthAuthentication())
     authorization = Authorization()
     detail_allowed_methods = []
     list_allowed_methods = ['post']
     object_class = GenericObject
     resource_name = 'prepare'
     validation = CleanedDataFormValidation(form_class=PrepareForm)
コード例 #6
0
 class Meta:
     queryset = MonolithRecord.objects.all()
     allowed_methods = ['get', 'delete']
     resource_name = 'data'
     filtering = {'recorded': ['exact', 'lt', 'lte', 'gt', 'gte'],
                  'key': ['exact', 'startswith'],
                  'id': ['lte', 'gte']}
     authorization = PermissionAuthorization('Monolith', 'API')
     authentication = OAuthAuthentication()
コード例 #7
0
ファイル: api.py プロジェクト: chenliu0831/zamboni
 class Meta(MarketplaceModelResource.Meta):
     queryset = Preview.objects.all()
     list_allowed_methods = ['post']
     allowed_methods = ['get', 'delete']
     always_return_data = True
     fields = ['id', 'filetype']
     authentication = OAuthAuthentication()
     authorization = OwnerAuthorization()
     resource_name = 'preview'
     filtering = {'addon': ALL_WITH_RELATIONS}
コード例 #8
0
 class Meta(MarketplaceModelResource.Meta):
     queryset = Addon.objects.filter(type=amo.ADDON_WEBAPP)
     fields = ['status', 'disabled_by_user']
     list_allowed_methods = []
     allowed_methods = ['patch', 'get']
     always_return_data = True
     authentication = OAuthAuthentication()
     authorization = AppOwnerAuthorization()
     resource_name = 'status'
     serializer = Serializer(formats=['json'])
コード例 #9
0
ファイル: resources.py プロジェクト: zzdjk6/zamboni
 class Meta:
     authentication = OAuthAuthentication()
     authorization = PermissionAuthorization('Transaction', 'NotifyFailure')
     detail_allowed_methods = ['patch']
     queryset = Contribution.objects.filter(uuid__isnull=False)
     resource_name = 'failure'
コード例 #10
0
 class Meta(MarketplaceResource.Meta):
     list_allowed_methods = ['post']
     detail_allowed_methods = []
     resource_name = 'newsletter'
     authorization = Authorization()
     authentication = (SharedSecretAuthentication(), OAuthAuthentication())
コード例 #11
0
 class Meta(MarketplaceResource.Meta):
     authentication = OAuthAuthentication()
     authorization = PermissionAuthorization('Apps', 'Review')
     list_allowed_methods = ['get']
     resource_name = 'reviewing'