Merge branch 'master' of ssh://bitbucket.org/yackob03/quay
This commit is contained in:
commit
77efd4afe8
2 changed files with 6 additions and 5 deletions
|
@ -1161,12 +1161,13 @@ def get_repo(namespace, repository):
|
||||||
|
|
||||||
|
|
||||||
@api.route('/repository/<path:repository>/build/', methods=['GET'])
|
@api.route('/repository/<path:repository>/build/', methods=['GET'])
|
||||||
@api_login_required
|
|
||||||
@parse_repository_name
|
@parse_repository_name
|
||||||
def get_repo_builds(namespace, repository):
|
def get_repo_builds(namespace, repository):
|
||||||
permission = ModifyRepositoryPermission(namespace, repository)
|
permission = ReadRepositoryPermission(namespace, repository)
|
||||||
if permission.can():
|
is_public = model.repository_is_public(namespace, repository)
|
||||||
|
if permission.can() or is_public:
|
||||||
def build_view(build_obj):
|
def build_view(build_obj):
|
||||||
|
# TODO(jake): Filter these logs if the current user can only *read* the repo.
|
||||||
if build_obj.status_url:
|
if build_obj.status_url:
|
||||||
# Delegate the status to the build node
|
# Delegate the status to the build node
|
||||||
node_status = requests.get(build_obj.status_url).json()
|
node_status = requests.get(build_obj.status_url).json()
|
||||||
|
@ -1190,7 +1191,7 @@ def get_repo_builds(namespace, repository):
|
||||||
'builds': [build_view(build) for build in builds]
|
'builds': [build_view(build) for build in builds]
|
||||||
})
|
})
|
||||||
|
|
||||||
abort(403) # Permissions denied
|
abort(403) # Permission denied
|
||||||
|
|
||||||
|
|
||||||
@api.route('/repository/<path:repository>/build/', methods=['POST'])
|
@api.route('/repository/<path:repository>/build/', methods=['POST'])
|
||||||
|
|
|
@ -2514,7 +2514,7 @@ quayApp.run(['$location', '$rootScope', 'Restangular', 'UserService', 'PlanServi
|
||||||
function($location, $rootScope, Restangular, UserService, PlanService, $http, $timeout) {
|
function($location, $rootScope, Restangular, UserService, PlanService, $http, $timeout) {
|
||||||
|
|
||||||
// Handle session security.
|
// Handle session security.
|
||||||
Restangular.setDefaultRequestParams({'_csrf_token': window.__token || ''});
|
Restangular.setDefaultRequestParams(['post', 'put', 'remove', 'delete'], {'_csrf_token': window.__token || ''});
|
||||||
|
|
||||||
// Handle session expiration.
|
// Handle session expiration.
|
||||||
Restangular.setErrorInterceptor(function(response) {
|
Restangular.setErrorInterceptor(function(response) {
|
||||||
|
|
Reference in a new issue