Re: Extending grant insert on tables to sequences - Mailing list pgsql-hackers

From Abhijit Menon-Sen
Subject Re: Extending grant insert on tables to sequences
Date
Msg-id 20080712113041.GA25112@toroid.org
Whole thread Raw
In response to Re: Extending grant insert on tables to sequences  ("Jaime Casanova" <jcasanov@systemguards.com.ec>)
Responses Re: Extending grant insert on tables to sequences
List pgsql-hackers
At 2008-07-11 11:57:37 -0500, jcasanov@systemguards.com.ec wrote:
>
> attached is a new version of the patch, it implements Alvaro's
> suggestion and fix a bug i found (it wasn't managing GRANT ALL) :(

Looks good to me.

> About the SELECT issue, AFAIU Robert doesn't complaint he just asked
> what is the use case... if people think it should be removed ok, but
> OTOH: why? i don't think that affects anything...

As I said, I don't feel too strongly about it.

>      <para>
> !     Granting permission on a table automatically extend 
> !     permissions to any sequences owned by the table, including 
> !     sequences tied to <type>SERIAL</> columns.
>      </para>

Should be "Granting permissions on a table automatically extends those
permissions to...".

> +     if ((istmt.objtype == ACL_OBJECT_RELATION) && (istmt.all_privs ||  
> +         (istmt.privileges & (ACL_INSERT | ACL_UPDATE | ACL_SELECT)))) 
> +     {

The parentheses around the first comparison can go away, and also the
ones around the ACL_* here:

> +             if (istmt.privileges & (ACL_INSERT)) 
> +                 istmt_seq.privileges |= ACL_USAGE;
> +             if (istmt.privileges & (ACL_UPDATE)) 
> +                 istmt_seq.privileges |= ACL_UPDATE;
> +             if (istmt.privileges & (ACL_SELECT)) 
> +                 istmt_seq.privileges |= ACL_SELECT;

-- ams


pgsql-hackers by date:

Previous
From: chris
Date:
Subject: Re: Follow-up on replication hooks for PostgreSQL
Next
From: Abhijit Menon-Sen
Date:
Subject: Re: posix advises ...