Add the ability to login with a robot, use the wrench icon for robots all over the place.

This commit is contained in:
yackob03 2013-11-20 19:43:19 -05:00
parent b407c1d9fb
commit e69591c7d6
8 changed files with 46 additions and 15 deletions

View file

@ -527,7 +527,7 @@ function RepoAdminCtrl($scope, Restangular, $routeParams, $rootScope) {
// Need the $scope.apply for both the permission stuff to change and for
// the XHR call to be made.
$scope.$apply(function() {
$scope.addRole(entity.name, 'read', entity.kind, entity.is_org_member)
$scope.addRole(entity.name, 'read', entity.kind);
});
};
@ -545,15 +545,14 @@ function RepoAdminCtrl($scope, Restangular, $routeParams, $rootScope) {
});
};
$scope.addRole = function(entityName, role, kind, is_org_member) {
$scope.addRole = function(entityName, role, kind) {
var permission = {
'role': role,
'is_org_member': is_org_member
};
var permissionPost = Restangular.one(getRestUrl('repository', namespace, name, 'permissions', kind, entityName));
permissionPost.customPOST(permission).then(function() {
$scope.permissions[kind][entityName] = permission;
permissionPost.customPOST(permission).then(function(result) {
$scope.permissions[kind][entityName] = result;
}, function(result) {
$('#cannotchangeModal').modal({});
});