pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
User and Groups
4+ messages / 2 participants
[nested] [flat]

* User and Groups
@ 1999-05-05 14:34 Greg Frith <greg@malthouse.demon.co.uk>
  0 siblings, 0 replies; 4+ messages in thread

From: Greg Frith @ 1999-05-05 14:34 UTC (permalink / raw)
  To: pgsql-sql

Hi, I'm having some problems trying to get my head around how users and groups
work.

I have 2 groups of users: client & consultants.  I create these groups as
follows:-


/* Group : create group consultants */
INSERT INTO pg_group VALUES ('consultants', '100');
INSERT INTO pg_group VALUES ('clients', '200');

I then create some tables and set the permissions on these tables as follows:-

REVOKE ALL ON clients, clientaddr, consultants, consultantaddr,
     systemconstants, clients_consultants, tasks, client_extras,
     timesheet, schedule, invoice, invoice_items,
     pg_user, pg_shadow
FROM GROUP clients;

GRANT ALL ON clients, clientaddr, consultants, consultantaddr,
     systemconstants, clients_consultants, tasks, client_extras,
     timesheet, schedule, invoice, invoice_items
TO GROUP consultants;

Now I create a user:-

testdb=> CREATE USER paul IN GROUP consultants;
CREATE USER

I login as this user and try a select on a table that should have permissions
set:-

testdb=> select * from consultants;
NOTICE:  in_group: group 100 not found
ERROR:  consultants: Permission denied.

I can't understand this - should I insert the user id of each consultant user
into grolist of pg_group where groname = consultants?

TOA

   --

---------------------------
Greg Frith - University Of Leeds : School of Computer Studies




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* RE: [SQL] User and Groups
@ 1999-05-05 16:39 Michael J Davis <michael.j.davis@tvguide.com>
  1999-05-05 23:16 ` Re: [SQL] User and Groups Greg Frith <greg@malthouse.demon.co.uk>
  0 siblings, 1 reply; 4+ messages in thread

From: Michael J Davis @ 1999-05-05 16:39 UTC (permalink / raw)
  To: 'greg@malthouse.demon.co.uk' <greg@malthouse.demon.co.uk>; pgsql-sql

For each group in pg_group you need to do the following:

UPDATE pg_group set grolist = '{501,514,502,503,504}' where grosysid = 1;

Where 501 - 504 is a list of pg_user.usesysid that should belong to the
group.

This really needs to be added to the documentation and "create user" needs
to be fixed to automatically do this.

	-----Original Message-----
	From:	Greg Frith [SMTP:greg@malthouse.demon.co.uk]
	Sent:	Wednesday, May 05, 1999 8:35 AM
	To:	pgsql-sql@postgreSQL.org
	Subject:	[SQL] User and Groups

	Hi, I'm having some problems trying to get my head around how users
and groups
	work.

	I have 2 groups of users: client & consultants.  I create these
groups as
	follows:-


	/* Group : create group consultants */
	INSERT INTO pg_group VALUES ('consultants', '100');
	INSERT INTO pg_group VALUES ('clients', '200');

	I then create some tables and set the permissions on these tables as
follows:-

	REVOKE ALL ON clients, clientaddr, consultants, consultantaddr,
	     systemconstants, clients_consultants, tasks, client_extras,
	     timesheet, schedule, invoice, invoice_items,
	     pg_user, pg_shadow
	FROM GROUP clients;

	GRANT ALL ON clients, clientaddr, consultants, consultantaddr,
	     systemconstants, clients_consultants, tasks, client_extras,
	     timesheet, schedule, invoice, invoice_items
	TO GROUP consultants;

	Now I create a user:-

	testdb=> CREATE USER paul IN GROUP consultants;
	CREATE USER

	I login as this user and try a select on a table that should have
permissions
	set:-

	testdb=> select * from consultants;
	NOTICE:  in_group: group 100 not found
	ERROR:  consultants: Permission denied.

	I can't understand this - should I insert the user id of each
consultant user
	into grolist of pg_group where groname = consultants?

	TOA

	   --

	---------------------------
	Greg Frith - University Of Leeds : School of Computer Studies
	



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [SQL] User and Groups
  1999-05-05 16:39 RE: [SQL] User and Groups Michael J Davis <michael.j.davis@tvguide.com>
@ 1999-05-05 23:16 ` Greg Frith <greg@malthouse.demon.co.uk>
  0 siblings, 0 replies; 4+ messages in thread

From: Greg Frith @ 1999-05-05 23:16 UTC (permalink / raw)
  To: Michael J Davis <michael.j.davis@tvguide.com>; +Cc: pgsql-sql

Hi Michael, thanks for your help.  Just after I posted the message I used this
manual insert method as a quick fix, its obviously the right way!!  So what is
the point of the IN GROUP directive or ADD USER?  Does this actually do
anything?

Michael J Davis wrote:

> For each group in pg_group you need to do the following:
>
> UPDATE pg_group set grolist = '{501,514,502,503,504}' where grosysid = 1;
>
> Where 501 - 504 is a list of pg_user.usesysid that should belong to the
> group.
>
> This really needs to be added to the documentation and "create user" needs
> to be fixed to automatically do this.
>
>         -----Original Message-----
>         From:   Greg Frith [SMTP:greg@malthouse.demon.co.uk]
>         Sent:   Wednesday, May 05, 1999 8:35 AM
>         To:     pgsql-sql@postgreSQL.org
>         Subject:        [SQL] User and Groups
>
>         Hi, I'm having some problems trying to get my head around how users
> and groups
>         work.
>
>         I have 2 groups of users: client & consultants.  I create these
> groups as
>         follows:-
>
>         /* Group : create group consultants */
>         INSERT INTO pg_group VALUES ('consultants', '100');
>         INSERT INTO pg_group VALUES ('clients', '200');
>
>         I then create some tables and set the permissions on these tables as
> follows:-
>
>         REVOKE ALL ON clients, clientaddr, consultants, consultantaddr,
>              systemconstants, clients_consultants, tasks, client_extras,
>              timesheet, schedule, invoice, invoice_items,
>              pg_user, pg_shadow
>         FROM GROUP clients;
>
>         GRANT ALL ON clients, clientaddr, consultants, consultantaddr,
>              systemconstants, clients_consultants, tasks, client_extras,
>              timesheet, schedule, invoice, invoice_items
>         TO GROUP consultants;
>
>         Now I create a user:-
>
>         testdb=> CREATE USER paul IN GROUP consultants;
>         CREATE USER
>
>         I login as this user and try a select on a table that should have
> permissions
>         set:-
>
>         testdb=> select * from consultants;
>         NOTICE:  in_group: group 100 not found
>         ERROR:  consultants: Permission denied.
>
>         I can't understand this - should I insert the user id of each
> consultant user
>         into grolist of pg_group where groname = consultants?
>
>         TOA
>
>            --
>
>         ---------------------------
>         Greg Frith - University Of Leeds : School of Computer Studies
>





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* RE: [SQL] User and Groups
@ 1999-05-06 15:08 Michael J Davis <michael.j.davis@tvguide.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Michael J Davis @ 1999-05-06 15:08 UTC (permalink / raw)
  To: 'greg@malthouse.demon.co.uk' <greg@malthouse.demon.co.uk>; +Cc: pgsql-sql

I have posted a bug report to the developers on this issue.  I feel it is a
bug (or oversight) in create user.

	-----Original Message-----
	From:	Greg Frith [SMTP:greg@malthouse.demon.co.uk]
	Sent:	Wednesday, May 05, 1999 5:17 PM
	To:	Michael J Davis
	Cc:	pgsql-sql@postgreSQL.org
	Subject:	Re: [SQL] User and Groups

	Hi Michael, thanks for your help.  Just after I posted the message I
used this
	manual insert method as a quick fix, its obviously the right way!!
So what is
	the point of the IN GROUP directive or ADD USER?  Does this actually
do
	anything?

	Michael J Davis wrote:

	> For each group in pg_group you need to do the following:
	>
	> UPDATE pg_group set grolist = '{501,514,502,503,504}' where
grosysid = 1;
	>
	> Where 501 - 504 is a list of pg_user.usesysid that should belong
to the
	> group.
	>
	> This really needs to be added to the documentation and "create
user" needs
	> to be fixed to automatically do this.
	>
	>         -----Original Message-----
	>         From:   Greg Frith [SMTP:greg@malthouse.demon.co.uk]
	>         Sent:   Wednesday, May 05, 1999 8:35 AM
	>         To:     pgsql-sql@postgreSQL.org
	>         Subject:        [SQL] User and Groups
	>
	>         Hi, I'm having some problems trying to get my head around
how users
	> and groups
	>         work.
	>
	>         I have 2 groups of users: client & consultants.  I create
these
	> groups as
	>         follows:-
	>
	>         /* Group : create group consultants */
	>         INSERT INTO pg_group VALUES ('consultants', '100');
	>         INSERT INTO pg_group VALUES ('clients', '200');
	>
	>         I then create some tables and set the permissions on these
tables as
	> follows:-
	>
	>         REVOKE ALL ON clients, clientaddr, consultants,
consultantaddr,
	>              systemconstants, clients_consultants, tasks,
client_extras,
	>              timesheet, schedule, invoice, invoice_items,
	>              pg_user, pg_shadow
	>         FROM GROUP clients;
	>
	>         GRANT ALL ON clients, clientaddr, consultants,
consultantaddr,
	>              systemconstants, clients_consultants, tasks,
client_extras,
	>              timesheet, schedule, invoice, invoice_items
	>         TO GROUP consultants;
	>
	>         Now I create a user:-
	>
	>         testdb=> CREATE USER paul IN GROUP consultants;
	>         CREATE USER
	>
	>         I login as this user and try a select on a table that
should have
	> permissions
	>         set:-
	>
	>         testdb=> select * from consultants;
	>         NOTICE:  in_group: group 100 not found
	>         ERROR:  consultants: Permission denied.
	>
	>         I can't understand this - should I insert the user id of
each
	> consultant user
	>         into grolist of pg_group where groname = consultants?
	>
	>         TOA
	>
	>            --
	>
	>         ---------------------------
	>         Greg Frith - University Of Leeds : School of Computer
Studies
	>
	



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~1999-05-06 15:08 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-05-05 14:34 User and Groups Greg Frith <greg@malthouse.demon.co.uk>
1999-05-05 16:39 RE: [SQL] User and Groups Michael J Davis <michael.j.davis@tvguide.com>
1999-05-05 23:16 ` Greg Frith <greg@malthouse.demon.co.uk>
1999-05-06 15:08 RE: [SQL] User and Groups Michael J Davis <michael.j.davis@tvguide.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox