From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id E586860724 for ; Wed, 9 Sep 2020 21:00:46 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D62CD13DB8 for ; Wed, 9 Sep 2020 21:00:46 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 256C513DAB for ; Wed, 9 Sep 2020 21:00:45 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id DD3D944ACD for ; Wed, 9 Sep 2020 21:00:44 +0200 (CEST) To: PVE development discussion , Tim Marx References: <20200706124544.2126341-1-t.marx@proxmox.com> From: Thomas Lamprecht Message-ID: <3da92568-0886-a522-fbd5-d28afe0f8e71@proxmox.com> Date: Wed, 9 Sep 2020 21:00:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:81.0) Gecko/20100101 Thunderbird/81.0 MIME-Version: 1.0 In-Reply-To: <20200706124544.2126341-1-t.marx@proxmox.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.630 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -1.626 Looks like a legit reply (A) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com, accesscontrol.pm] Subject: Re: [pve-devel] [PATCH v3 access-control] add ui capabilities endpoint X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 19:00:47 -0000 On 06.07.20 14:45, Tim Marx wrote: > Signed-off-by: Tim Marx > --- > * no changes Maybe we could merge this into the "/access/permissions" endpoint, maybe = with a "heurisitic" parameter? >=20 > PVE/API2/AccessControl.pm | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) >=20 > diff --git a/PVE/API2/AccessControl.pm b/PVE/API2/AccessControl.pm > index fd27786..66319cc 100644 > --- a/PVE/API2/AccessControl.pm > +++ b/PVE/API2/AccessControl.pm > @@ -718,4 +718,33 @@ __PACKAGE__->register_method({ > return $res; > }}); >=20 > +__PACKAGE__->register_method({ > + name =3D> 'uicapabilities', > + path =3D> 'uicapabilities', > + method =3D> 'GET', > + description =3D> 'Retrieve user interface capabilities for calling= user/token.', > + permissions =3D> { > + description =3D> "Each user/token is allowed to retrieve their own ca= pabilities.", > + user =3D> 'all', > + }, > + parameters =3D> {}, > + returns =3D> { > + type =3D> 'object', > + properties =3D> { > + cap =3D> { > + type =3D> 'object', > + description =3D> 'The user interface capabilities of the calling use= r/token' > + } > + }, > + }, > + code =3D> sub { > + my ($param) =3D @_; > + > + my $rpcenv =3D PVE::RPCEnvironment::get(); > + my $userid =3D $rpcenv->get_user(); > + my $res->{cap} =3D &$compute_api_permission($rpcenv, $userid); > + > + return $res; > + }}); > + > 1; > -- > 2.20.1 >=20 > _______________________________________________ > pve-devel mailing list > pve-devel@pve.proxmox.com > https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel >=20