Merge branch 'koh'

Conflicts:
	auth/scopes.py
	requirements-nover.txt
	requirements.txt
	static/css/quay.css
	static/directives/namespace-selector.html
	static/js/app.js
	static/partials/manage-application.html
	templates/oauthorize.html
This commit is contained in:
Jimmy Zelinskie 2014-12-01 12:30:09 -08:00
commit f3259c862b
57 changed files with 537 additions and 141 deletions

View file

@ -1,9 +1,11 @@
from flask import request
from endpoints.api import (resource, nickname, ApiResource, validate_json_request, request_error,
log_action, Unauthorized, NotFound, internal_only)
log_action, Unauthorized, NotFound, internal_only, path_param,
require_scope)
from auth.permissions import AdministerOrganizationPermission
from auth.auth_context import get_authenticated_user
from auth import scopes
from data import model
@ -54,7 +56,7 @@ def log_prototype_action(action_kind, orgname, prototype, **kwargs):
@resource('/v1/organization/<orgname>/prototypes')
@internal_only
@path_param('orgname', 'The name of the organization')
class PermissionPrototypeList(ApiResource):
""" Resource for listing and creating permission prototypes. """
schemas = {
@ -115,6 +117,7 @@ class PermissionPrototypeList(ApiResource):
},
}
@require_scope(scopes.ORG_ADMIN)
@nickname('getOrganizationPrototypePermissions')
def get(self, orgname):
""" List the existing prototypes for this organization. """
@ -131,6 +134,7 @@ class PermissionPrototypeList(ApiResource):
raise Unauthorized()
@require_scope(scopes.ORG_ADMIN)
@nickname('createOrganizationPrototypePermission')
@validate_json_request('NewPrototype')
def post(self, orgname):
@ -179,7 +183,8 @@ class PermissionPrototypeList(ApiResource):
@resource('/v1/organization/<orgname>/prototypes/<prototypeid>')
@internal_only
@path_param('orgname', 'The name of the organization')
@path_param('prototypeid', 'The ID of the prototype')
class PermissionPrototype(ApiResource):
""" Resource for managingin individual permission prototypes. """
schemas = {
@ -204,6 +209,7 @@ class PermissionPrototype(ApiResource):
},
}
@require_scope(scopes.ORG_ADMIN)
@nickname('deleteOrganizationPrototypePermission')
def delete(self, orgname, prototypeid):
""" Delete an existing permission prototype. """
@ -224,6 +230,7 @@ class PermissionPrototype(ApiResource):
raise Unauthorized()
@require_scope(scopes.ORG_ADMIN)
@nickname('updateOrganizationPrototypePermission')
@validate_json_request('PrototypeUpdate')
def put(self, orgname, prototypeid):