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) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 50CC363789 for ; Fri, 25 Feb 2022 13:24:04 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4435021E11 for ; Fri, 25 Feb 2022 13:24:04 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (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 EF3A421E06 for ; Fri, 25 Feb 2022 13:24:02 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id BAA9146120 for ; Fri, 25 Feb 2022 13:24:02 +0100 (CET) Message-ID: <7865b759-659f-2770-3236-3f44a560aeff@proxmox.com> Date: Fri, 25 Feb 2022 13:24:01 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Thunderbird/98.0 Content-Language: en-GB To: Proxmox VE development discussion , Dominik Csapak , =?UTF-8?Q?Fabian_Gr=c3=bcnbichler?= References: <20220208131011.752134-1-o.bektas@proxmox.com> <20220208131011.752134-5-o.bektas@proxmox.com> <1644500864.trbyijgtmq.astroid@nora.none> From: Thomas Lamprecht In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -2.443 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_SOMETLD_ARE_BAD_TLD 5 .stream, .trade, .pw, .top, .press, .guru, .casa, .online, .cam, .shop, .bar, .club, .sbs & .date TLD Abuse NICE_REPLY_A -0.001 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: Re: [pve-devel] [PATCH v1 manager 4/5] change 'root@pam' checks with 'SuperUser' capability check 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: Fri, 25 Feb 2022 12:24:04 -0000 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.