public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: Re: [pve-devel] [PATCH storage 1/4] check volume access: allow if user has VM.Config.Disk
Date: Tue, 22 Mar 2022 09:31:49 +0100	[thread overview]
Message-ID: <159a4067-39b4-c63a-c267-189c908465c3@proxmox.com> (raw)
In-Reply-To: <20220321130633.62086-2-f.ebner@proxmox.com>

Am 21.03.22 um 14:06 schrieb Fabian Ebner:
> Listing guest images should not require Datastore.Allocate in this
> case. In preparation for adding disk import to the GUI.
> 
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
>  PVE/Storage.pm | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/PVE/Storage.pm b/PVE/Storage.pm
> index 6112991..efa304a 100755
> --- a/PVE/Storage.pm
> +++ b/PVE/Storage.pm
> @@ -486,6 +486,8 @@ sub check_volume_access {
>  	} elsif ($vtype eq 'backup' && $ownervm) {
>  	    $rpcenv->check($user, "/storage/$sid", ['Datastore.AllocateSpace']);
>  	    $rpcenv->check($user, "/vms/$ownervm", ['VM.Backup']);
> +	} elsif (($vtype eq 'images' || $vtype eq 'rootdir') && $ownervm) {
> +	    $rpcenv->check($user, "/vms/$ownervm", ['VM.Config.Disk']);

Of course this needs to be or-ed with the Datastore.Allocate privilege.
Will fix it in v2.

>  	} else {
>  	    # allow if we are Datastore administrator
>  	    $rpcenv->check($user, "/storage/$sid", ['Datastore.Allocate']);




  reply	other threads:[~2022-03-22  8:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-21 13:06 [pve-devel] [PATCH-SERIES storage/manager/container/qemu-server] improve check_volume_access Fabian Ebner
2022-03-21 13:06 ` [pve-devel] [PATCH storage 1/4] check volume access: allow if user has VM.Config.Disk Fabian Ebner
2022-03-22  8:31   ` Fabian Ebner [this message]
2022-03-22  9:31     ` Fabian Ebner
2022-03-24  8:18       ` Fabian Grünbichler
2022-03-28  9:07         ` Fabian Ebner
2022-03-28 11:36           ` Fabian Grünbichler
2022-03-29  7:48             ` Fabian Ebner
2022-03-29 12:33               ` Fabian Grünbichler
2022-03-21 13:06 ` [pve-devel] [PATCH storage 2/4] check volume accesss: add content type parameter Fabian Ebner
2022-03-21 13:06 ` [pve-devel] [PATCH storage 3/4] pvesm: extract config: add content type check Fabian Ebner
2022-03-21 13:06 ` [pve-devel] [PATCH storage 4/4] api: file restore: use check_volume_access to restrict content type Fabian Ebner
2022-03-21 13:06 ` [pve-devel] [PATCH manager 1/2] pveam: remove: add content type check Fabian Ebner
2022-03-21 13:06 ` [pve-devel] [PATCH manager 2/2] api: vzdump: extract config: " Fabian Ebner
2022-03-21 13:06 ` [pve-devel] [PATCH container 1/1] api: create/modify: add content type checks Fabian Ebner
2022-03-21 13:06 ` [pve-devel] [PATCH qemu-server " Fabian Ebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=159a4067-39b4-c63a-c267-189c908465c3@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal