Index: openacs-4/packages/acs-subsite/www/permissions/one-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/one-oracle.xql,v diff -u -r1.3.4.1 -r1.3.4.2 --- openacs-4/packages/acs-subsite/www/permissions/one-oracle.xql 7 Dec 2002 16:06:29 -0000 1.3.4.1 +++ openacs-4/packages/acs-subsite/www/permissions/one-oracle.xql 2 Aug 2003 05:37:46 -0000 1.3.4.2 @@ -22,7 +22,7 @@ select grantee_id, acs_object.name(grantee_id) as grantee_name, privilege, -1 as counter from acs_permissions - where object_id = :object_id) + where object_id = :object_id ) group by grantee_id, grantee_name, privilege having sum(counter) > 0 @@ -37,6 +37,7 @@ privilege from acs_permissions where object_id = :object_id + $extra_where_clause Index: openacs-4/packages/acs-subsite/www/permissions/one-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/one-postgresql.xql,v diff -u -r1.4.4.2 -r1.4.4.3 --- openacs-4/packages/acs-subsite/www/permissions/one-postgresql.xql 8 Dec 2002 14:59:14 -0000 1.4.4.2 +++ openacs-4/packages/acs-subsite/www/permissions/one-postgresql.xql 2 Aug 2003 05:37:46 -0000 1.4.4.3 @@ -22,7 +22,7 @@ select grantee_id, acs_object__name(grantee_id) as grantee_name, privilege, -1 as counter from acs_permissions - where object_id = :object_id) dummy + where object_id = :object_id ) dummy group by grantee_id, grantee_name, privilege having sum(counter) > 0 @@ -37,6 +37,7 @@ privilege from acs_permissions where object_id = :object_id + $extra_where_clause Index: openacs-4/packages/acs-subsite/www/permissions/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/one.tcl,v diff -u -r1.2.2.3 -r1.2.2.4 --- openacs-4/packages/acs-subsite/www/permissions/one.tcl 1 May 2003 19:18:29 -0000 1.2.2.3 +++ openacs-4/packages/acs-subsite/www/permissions/one.tcl 2 Aug 2003 05:37:46 -0000 1.2.2.4 @@ -16,8 +16,22 @@ set user_id [ad_maybe_redirect_for_registration] ad_require_permission $object_id admin -set name [ad_quotehtml [db_string name {select acs_object.name(:object_id) from dual}]] +# +# RBM: Check if this is the Main Site and prevent the user from being +# able to remove Read permission on "The Public" and locking +# him/herself out. +# +set node_id [site_node::get_node_id_from_object_id -object_id $object_id] +set ancestor [site_node::closest_ancestor_package -node_id $node_id] +set extra_where_clause "" + +if {[empty_string_p $ancestor]} { + set extra_where_clause "AND grantee_id <> -1" +} + +set name [ad_quotehtml [db_string name {}]] + set context [list [list "./" "Permissions"] "Permissions for $name"] db_multirow inherited inherited_permissions { *SQL* } {