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

Stoiko Ivanov s.ivanov at proxmox.com
Thu Jun 21 16:14:54 CEST 2018


On Thu, Jun 21, 2018 at 03:30:12PM +0200, Dietmar Maurer wrote:
> 
> 
> > 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;
agreed - will send an updated patch.
> 
> 
> >  }
> >  
> >  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