[pve-devel] [PATCH access-control v5 1/5] fix PVE::AccessControl::role_is_special

Dietmar Maurer dietmar at proxmox.com
Thu Jun 21 15:30:12 CEST 2018



> On June 21, 2018 at 2:31 PM Stoiko Ivanov <s.ivanov at proxmox.com> wrote:
> 
> 
> PVE::AccessControl::role_is_special now returns 0 instead of '' for false
> (Schemavalidation did complain about '')
> 
> Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
> ---
>  PVE/AccessControl.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/PVE/AccessControl.pm b/PVE/AccessControl.pm
> index f0fb7dc..f847a8b 100644
> --- a/PVE/AccessControl.pm
> +++ b/PVE/AccessControl.pm
> @@ -501,7 +501,7 @@ create_roles();
>  
>  sub role_is_special {
>      my ($role) = @_;
> -    return exists $special_roles->{$role};
> +    return (exists $special_roles->{$role} ? 1 : 0);

why do we need parantees here? IMHO it would be more clear to use:

 return (exists $special_roles->{$role}) ? 1 : 0;


>  }
>  
>  sub add_role_privs {
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel




More information about the pve-devel mailing list