Fixed modal to revoke user certificate.

This commit is contained in:
Pino de Candia 2018-01-24 05:55:27 +00:00
parent 0c5e3d5aa8
commit 49e4d9556c
2 changed files with 9 additions and 9 deletions

View File

@ -119,14 +119,14 @@
"schema": {
"type": "object",
"properties": {
"'pub_key'": {
"pub_key": {
"type": "string"
}
}
},
"form": [
{
"key": "'pub_key'",
"key": "pub_key",
"type": "textarea",
"title": gettext("SSH Public Key"),
"description": gettext("The user's SSH public key."),

View File

@ -60,7 +60,7 @@
var notAllowedMessage = gettext("You are not allowed to revoke user certificates: %s");
var service = {
initScope: initScope,
initAction: initAction,
allowed: allowed,
perform: perform
};
@ -69,19 +69,19 @@
//////////////
function initScope(newScope) {
scope = newScope;
function initAction() {
context = { };
revokeUserPromise = policy.ifAllowed({rules: [['ssh', 'revoke_user_cert']]});
}
function perform(items) {
var certs = angular.isArray(items) ? items : [items];
context.labels = labelize(certs.length);
function perform(items, thescope) {
scope = thescope
var users = angular.isArray(items) ? items : [items];
context.labels = labelize(users.length);
return $qExtensions.allSettled(users.map(checkPermission)).then(afterCheck);
}
function allowed(user) {
function allowed(user, thescope) {
// only row actions pass in user
// otherwise, assume it is a batch action
if (user) {