diff --git a/static/directives/manage-users-tab.html b/static/directives/manage-users-tab.html
index 730ebf15a..58be3248f 100644
--- a/static/directives/manage-users-tab.html
+++ b/static/directives/manage-users-tab.html
@@ -86,7 +86,7 @@
Disable Enable User
-
Take Ownership
@@ -102,13 +102,9 @@
dialog-action="takeOwnership(info, callback)"
dialog-title="Take Ownership"
dialog-action-title="Take Ownership">
- Are you sure you want to take ownership of
- organization {{ takeOwnershipInfo.entity.name }}?
- user namespace {{ takeOwnershipInfo .entity.username }}?
-
-
+
Note: This will convert the user namespace into an organization. The user will no longer be able to login
to
this account.
diff --git a/static/js/directives/ui/manage-user-tab.js b/static/js/directives/ui/manage-user-tab.js
index 7695936b4..8e86cb0a7 100644
--- a/static/js/directives/ui/manage-user-tab.js
+++ b/static/js/directives/ui/manage-user-tab.js
@@ -228,10 +228,9 @@ angular.module('quay').directive('manageUserTab', function () {
});
};
- $scope.askTakeOwnership = function (entity, is_org) {
+ $scope.askTakeOwnership = function (entity) {
$scope.takeOwnershipInfo = {
- 'entity': entity,
- 'is_org': is_org
+ 'entity': entity
};
};
diff --git a/static/js/pages/superuser.js b/static/js/pages/superuser.js
index b94db2314..d8b02051b 100644
--- a/static/js/pages/superuser.js
+++ b/static/js/pages/superuser.js
@@ -10,7 +10,7 @@
})
}]);
- function SuperuserCtrl($scope, ApiService, Features, UserService, ContainerService, AngularPollChannel, CoreDialog, TableService) {
+ function SuperuserCtrl($scope, $location, ApiService, Features, UserService, ContainerService, AngularPollChannel, CoreDialog, TableService) {
if (!Features.SUPER_USERS) {
return;
}
@@ -198,6 +198,24 @@
});
};
+ $scope.askTakeOwnership = function (entity) {
+ $scope.takeOwnershipInfo = {
+ 'entity': entity
+ };
+ };
+
+ $scope.takeOwnership = function (info, callback) {
+ var errorDisplay = ApiService.errorDisplay('Could not take ownership of namespace', callback);
+ var params = {
+ 'namespace': info.entity.username || info.entity.name
+ };
+
+ ApiService.takeOwnership(null, params).then(function () {
+ callback(true);
+ $location.path('/organization/' + params.namespace);
+ }, errorDisplay)
+ };
+
$scope.checkStatus = function() {
ContainerService.checkStatus(function(resp) {
$('#restartingContainerModal').modal('hide');
diff --git a/static/partials/super-user.html b/static/partials/super-user.html
index ec6c6b519..827a49e59 100644
--- a/static/partials/super-user.html
+++ b/static/partials/super-user.html
@@ -172,7 +172,7 @@
Delete Organization
-
+
Take Ownership
@@ -211,6 +211,13 @@
+