]> git.proxmox.com Git - pmg-api.git/commitdiff
API: Actions: also return if action is editable
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 23 Oct 2019 11:56:06 +0000 (13:56 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 23 Oct 2019 17:19:04 +0000 (19:19 +0200)
API clients, like our web interface, can usen use this to show if a
action is editable or not, allowing to improve UX.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-By: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-By: Stoiko Ivanov <s.ivanov@proxmox.com>
src/PMG/API2/Action.pm

index 7dd225d34c2e8f5a91d717a62e7427c8fb46a8df..a71f27db9f0e4fe8c08f9241d0e4c470b7fff084 100644 (file)
@@ -31,6 +31,7 @@ my $format_action_object = sub {
     $data->{id} = "$data->{ogroup}_$data->{id}";
     $data->{name} = $og->{name};
     $data->{info} = $og->{info};
+    $data->{editable} = $action->oisedit();
 
     return $data;
 };