diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-12-01 08:50:00 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-01 08:50:00 +0000 |
commit | 91c4bda1ec6640abb8b1a585e1fd1f8955d53fd1 (patch) | |
tree | 42f8f79c6d356a04d0e8365a0921d7257f12c64d /modules/user/helpers/group.php | |
parent | ab0fcb7453db7d93c9dc1dfd38e6d6f84a5b16b5 (diff) |
Prototype access control model. There's much left to do, but it's a
working implementation.
Diffstat (limited to 'modules/user/helpers/group.php')
-rw-r--r-- | modules/user/helpers/group.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/user/helpers/group.php b/modules/user/helpers/group.php index 2e6a3962..12118432 100644 --- a/modules/user/helpers/group.php +++ b/modules/user/helpers/group.php @@ -24,6 +24,7 @@ * Note: by design, this class does not do any permission checking. */ class group_Core { + const EVERYBODY = 0; const REGISTERED_USERS = 1; /** @@ -41,9 +42,7 @@ class group_Core { $group->name = $name; $group->save(); - // Create the view column for this group in the items table. - Database::instance()->query("ALTER TABLE `items` ADD `view_{$group->id}` BOOLEAN DEFAULT 0"); - + module::event("group_created", $group); return $group; } @@ -56,8 +55,7 @@ class group_Core { $group = ORM::factory("group", $id); if ($group->loaded) { - // Drop the view column for this group in the items table. - Database::instance()->query("ALTER TABLE `items` DROP `view_{$group->id}`"); + module::event("group_before_delete", $group); $group->delete(); } } |