[pve-devel] applied: [PATCH 19/23] subscription: use rpcenv for permission check
Thomas Lamprecht
t.lamprecht at proxmox.com
Thu Oct 17 16:56:08 CEST 2019
On 10/17/19 3:14 PM, Fabian Grünbichler wrote:
> this is the last caller of PVE::AccessControl::check_permissions(),
> which is the last caller of PVE::AccessControl::permission(). both can
> thus be dropped altogether.
>
> Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
> ---
>
> Notes:
> this is semi-independent, but if applied we need to remember that the
> corresponding patch in pve-access-control needs to break on pve-manager with
> the right version
>
> PVE/API2/Subscription.pm | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/PVE/API2/Subscription.pm b/PVE/API2/Subscription.pm
> index 2c0c4e84..959c2c1b 100644
> --- a/PVE/API2/Subscription.pm
> +++ b/PVE/API2/Subscription.pm
> @@ -108,7 +108,7 @@ __PACKAGE__->register_method ({
>
> my $rpcenv = PVE::RPCEnvironment::get();
> my $authuser = $rpcenv->get_user();
> - my $has_permission = PVE::AccessControl::check_permissions($authuser, "/nodes/$node", 'Sys.Audit');
> + my $has_permission = $rpcenv->check($authuser, "/nodes/$node", ['Sys.Audit'], 1);
>
> my $server_id = PVE::API2Tools::get_hwaddress();
> my $url = "https://www.proxmox.com/proxmox-ve/pricing";
>
applied, but added some historic/meta info + "api:" prefix in the subject.
A break of pve-manager <= 6.0-9 can be send along in a next revision of this
series, together with the removal patch, thanks!
More information about the pve-devel
mailing list