Made a stupid assumption about when users belonged to an organization, now paying for my terrible ways.

This commit is contained in:
yackob03 2013-11-04 18:52:38 -05:00
parent 109f09f0d0
commit 3a11ea4229
5 changed files with 71 additions and 33 deletions

View file

@ -303,7 +303,7 @@ quayApp.directive('entitySearch', function () {
}
template += '<span class="name">' + datum.value + '</span>';
if (datum.entity.outside_org) {
if (!datum.entity.is_org_member) {
template += '<div class="alert-warning warning">This user is outside your organization</div>';
}

View file

@ -562,7 +562,7 @@ function RepoAdminCtrl($scope, Restangular, $routeParams, $rootScope) {
$scope.grantRole = function() {
$('#confirmaddoutsideModal').modal('hide');
var entity = $scope.currentAddEntity;
$scope.addRole(entity.name, 'read', entity.kind, entity.outside_org)
$scope.addRole(entity.name, 'read', entity.kind, entity.is_org_member)
$scope.currentAddEntity = null;
};
@ -570,7 +570,7 @@ function RepoAdminCtrl($scope, Restangular, $routeParams, $rootScope) {
// Don't allow duplicates.
if ($scope.permissions[entity.kind][entity.name]) { return; }
if (entity.outside_org) {
if (!entity.is_org_member) {
$scope.currentAddEntity = entity;
$('#confirmaddoutsideModal').modal('show');
return;
@ -579,7 +579,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.outside_org)
$scope.addRole(entity.name, 'read', entity.kind, entity.is_org_member)
});
};
@ -596,10 +596,10 @@ function RepoAdminCtrl($scope, Restangular, $routeParams, $rootScope) {
});
};
$scope.addRole = function(entityName, role, kind, outside_org) {
$scope.addRole = function(entityName, role, kind, is_org_member) {
var permission = {
'role': role,
'outside_org': !!outside_org
'is_org_member': !!is_org_member
};
var permissionPost = Restangular.one(getRestUrl('repository', namespace, name, 'permissions', kind, entityName));