From 493ec64cbaa811b2285027a59d83645f818a58be Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Mon, 3 Jan 2011 10:10:52 +1300 Subject: [PATCH] Extend default_privileges to members of a group. Signed-off-by: Andrew McMillan --- dba/caldav_functions.sql | 7 ++++++- issues/i_425c24ae.cil | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/dba/caldav_functions.sql b/dba/caldav_functions.sql index f583afcb..5bd2f3a5 100644 --- a/dba/caldav_functions.sql +++ b/dba/caldav_functions.sql @@ -929,7 +929,12 @@ BEGIN SELECT privileges FROM grants WHERE by_principal=in_grantor AND by_collection IS NULL AND (to_principal=in_accessor OR to_principal IN (SELECT expand_memberships(in_accessor,in_depth))) UNION - SELECT 32::BIT(24) AS privileges FROM expand_memberships(in_accessor,in_depth) WHERE expand_memberships = in_grantor + SELECT bit_or(sq2.privileges) FROM + ( + SELECT 32::BIT(24) AS privileges FROM expand_memberships(in_accessor,in_depth) WHERE expand_memberships = in_grantor + UNION + SELECT default_privileges AS privileges FROM principal WHERE principal_id = in_grantor + ) AS sq2 ) AS subquery ; IF out_conferred IS NULL THEN diff --git a/issues/i_425c24ae.cil b/issues/i_425c24ae.cil index fbb5137c..d7afae9f 100644 --- a/issues/i_425c24ae.cil +++ b/issues/i_425c24ae.cil @@ -1,9 +1,9 @@ Summary: Group does not confer default permission to members -Status: New +Status: Finished CreatedBy: Andrew McMillan -AssignedTo: +AssignedTo: Andrew McMillan Inserted: 2010-12-29T23:42:42 -Updated: 2010-12-29T23:42:42 +Updated: 2011-01-02T21:10:16 A member of a group should have a minimum of the default permission granted to them when accessing things owned directly by that group.