parent
ae779cade2
commit
34ab6e4ccc
1 changed files with 13 additions and 4 deletions
|
@ -28,11 +28,16 @@ angular.module('quay').directive('repositoryPermissionsTable', function () {
|
|||
'repository': '=repository',
|
||||
'isEnabled': '=isEnabled'
|
||||
},
|
||||
controller: function($scope, $element, ApiService, Restangular, UtilService) {
|
||||
controller: function($scope, $element, ApiService, Restangular, UtilService, RolesService) {
|
||||
$scope.permissionResources = {'team': {}, 'user': {}};
|
||||
$scope.permissionCache = {};
|
||||
$scope.permissions = {};
|
||||
$scope.addPermissionInfo = {};
|
||||
|
||||
var readRole = RolesService.repoRoles[0].id;
|
||||
|
||||
$scope.addPermissionInfo = {
|
||||
'role': readRole
|
||||
};
|
||||
|
||||
var loadAllPermissions = function() {
|
||||
if (!$scope.repository || !$scope.isEnabled) { return; }
|
||||
|
@ -160,13 +165,17 @@ angular.module('quay').directive('repositoryPermissionsTable', function () {
|
|||
|
||||
var errorHandler = ApiService.errorDisplay('Cannot change permission', function() {
|
||||
opt_callback && opt_callback(false);
|
||||
$scope.addPermissionInfo = {};
|
||||
$scope.addPermissionInfo = {
|
||||
'role': readRole
|
||||
};
|
||||
});
|
||||
|
||||
var endpoint = getPermissionEndpoint(entityName, kind);
|
||||
endpoint.customPUT(permission).then(function(result) {
|
||||
$scope.permissions[kind][entityName] = result;
|
||||
$scope.addPermissionInfo = {};
|
||||
$scope.addPermissionInfo = {
|
||||
'role': readRole
|
||||
};
|
||||
opt_callback && opt_callback(true)
|
||||
}, errorHandler);
|
||||
};
|
||||
|
|
Reference in a new issue