From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: "Proxmox VE development discussion" <pve-devel@lists.proxmox.com>,
"Dominik Csapak" <d.csapak@proxmox.com>,
"Fabian Grünbichler" <f.gruenbichler@proxmox.com>
Subject: Re: [pve-devel] [PATCH v1 manager 4/5] change 'root@pam' checks with 'SuperUser' capability check
Date: Fri, 25 Feb 2022 13:24:01 +0100 [thread overview]
Message-ID: <7865b759-659f-2770-3236-3f44a560aeff@proxmox.com> (raw)
In-Reply-To: <bde799db-698d-f598-2242-debe770c3ae0@proxmox.com>
On 25/02/2022 11:13, Dominik Csapak wrote:
>>> - enableFn: rec => caps.access['User.Modify'] && rec.data.userid !== 'root@pam',
>>> + enableFn: rec => caps.access['User.Modify'] && !caps.access.SuperUser,
>> no rationale given for the different way of accessing - I'll leave it to
>> more JS affine reviewers to decide whether this is sensible or not, but
>> please provide the reason WHY this doesn't use `caps.access['SuperUser']`
>
> just to give the reason:
>
> eslint complains if we use foo['bar'] when we could use foo.bar
>
> we prefer 'dot-notation' (so foo.bar.baz) for objects, but in
> all other cases of the caps object that does not work because
> the keys themselves contain a '.'
one just add a comment to tell eslint to ignore that one in that case
though, else this may always look a bit weird to people reading over the
code by accident.
next prev parent reply other threads:[~2022-02-25 12:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-08 13:10 [pve-devel] [PATCH v1 access-control++ 0/5] SuperUser privilege Oguz Bektas
2022-02-08 13:10 ` [pve-devel] [PATCH v1 access-control 1/5] add default "SuperAdministrator" role with the new "SuperUser" privilege Oguz Bektas
2022-02-08 13:10 ` [pve-devel] [PATCH v1 access-control 2/5] tfa: allow superusers to edit root@pam tfa Oguz Bektas
[not found] ` <<20220208131011.752134-3-o.bektas@proxmox.com>
2022-02-10 15:30 ` Fabian Grünbichler
2022-02-08 13:10 ` [pve-devel] [PATCH v1 container 3/5] fix #2582: api: add checks for 'SuperUser' privilege for root-only options Oguz Bektas
[not found] ` <<20220208131011.752134-4-o.bektas@proxmox.com>
2022-02-10 15:30 ` Fabian Grünbichler
2022-02-08 13:10 ` [pve-devel] [PATCH v1 manager 4/5] change 'root@pam' checks with 'SuperUser' capability check Oguz Bektas
[not found] ` <<20220208131011.752134-5-o.bektas@proxmox.com>
2022-02-10 15:29 ` Fabian Grünbichler
2022-02-25 10:13 ` Dominik Csapak
2022-02-25 12:24 ` Thomas Lamprecht [this message]
2022-02-08 13:10 ` [pve-devel] [PATCH v1 qemu-server 5/5] add SuperUser privilege checks for root-only options Oguz Bektas
[not found] ` <<20220208131011.752134-6-o.bektas@proxmox.com>
2022-02-10 15:29 ` Fabian Grünbichler
2022-02-10 15:28 ` [pve-devel] [PATCH v1 access-control++ 0/5] SuperUser privilege Fabian Grünbichler
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=7865b759-659f-2770-3236-3f44a560aeff@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=d.csapak@proxmox.com \
--cc=f.gruenbichler@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.