Commit Graph

25 Commits

Author SHA1 Message Date
Bharat Mediratta
3d2fc86604 Permission only function on albums. 2008-12-16 00:30:05 +00:00
Bharat Mediratta
af8c74f612 Fix a bug where parent permissions were not getting inherited to newly
created albums and photos.
2008-12-13 20:06:20 +00:00
Bharat Mediratta
8ba5ea3cf8 Make sure that access::can fails if the item is not loaded 2008-12-13 19:49:33 +00:00
Bharat Mediratta
a3142246e4 Move the view permission cache directly into the item table for efficiency. Unit tests ftw! 2008-12-12 06:54:48 +00:00
Bharat Mediratta
2cf3233f54 Get rid of all pseudo users and pseudo groups, while preserving all
other functionality.  This makes our user/group and access code
fully consistent.
2008-12-12 00:59:30 +00:00
Bharat Mediratta
914164d5eb Split _update_access_cache into two functions separating view from
non-view.  This is a step along the path towards moving the view
access cache into the item model.
2008-12-11 19:06:40 +00:00
Tim Almdal
52ed3f11fd Fix problem with access::can, where the $item->id was being passed to the access_group::can method. 2008-12-10 22:19:39 +00:00
Bharat Mediratta
18a6614a11 Change all access API methods to take ORMs instead of ids. This will
minimize reloading objects from the database.
2008-12-10 07:05:49 +00:00
Bharat Mediratta
4a0e4b798e Check view permissions before allowing view access to albums/photos. 2008-12-09 10:14:09 +00:00
Bharat Mediratta
e62103b8d9 Move code to delete users and add/remove users from groups into the
model.
2008-12-09 08:47:30 +00:00
Bharat Mediratta
e3ad42a276 Add access::can() which verifies that the user belongs to a group that has the
given permission.
2008-12-09 00:02:20 +00:00
Bharat Mediratta
bd3a472be7 Rename access::can() to access::group_can() 2008-12-08 10:46:53 +00:00
Bharat Mediratta
5d23a6515d Finish writing unit tests for Access. No bugs found! 2008-12-07 10:56:44 +00:00
Bharat Mediratta
9ba9f7bf27 Change the startup code to only put installed modules on the autoload
path.  This breaks a bunch of places where we had hardcoded
dependencies, so guard all of those cases.  Restructure
module::available() a bit and the way that we do install/uninstall in
the scaffolding.
2008-12-04 07:44:28 +00:00
Bharat Mediratta
bae905a4cb Improvements to access helper.
o Rename access::remove_group() to access::delete_group() for
  consistency.

o Wrote more unit tests

o Tests found a bug in access::remove_item() .. yay!
2008-12-04 06:40:35 +00:00
Bharat Mediratta
c3478675cd Fix a bug where we weren't actually deleting permissions (hooray for unit tests!) 2008-12-03 19:09:56 +00:00
Bharat Mediratta
e03bb0f7c3 Re-enable access_cache propagation now that we've patched the MySQL driver. 2008-12-03 04:28:14 +00:00
Bharat Mediratta
718ac67a02 get rid of a stray space that was breaking the File_Structure_Test 2008-12-03 04:17:02 +00:00
Bharat Mediratta
c1886aab88 Temporarily disable some code to get tests to pass. 2008-12-03 04:05:24 +00:00
Bharat Mediratta
db5bc20500 Fix a bad copy/pasted comment 2008-12-03 03:18:43 +00:00
Bharat Mediratta
ea11562e32 Oops, this was missing from the last fix. 2008-12-02 04:54:37 +00:00
Bharat Mediratta
ae4c828b06 Fix a problem in _update_access_cache() where if the intent is
default, we weren't properly propagating ALLOW where necessary.
2008-12-02 04:38:45 +00:00
Bharat Mediratta
5c303aa07b Add access::reset() so that you can specify your intent to use the
parent's permissions.

Update scaffolding to demonstrate that it works.
2008-12-01 09:57:03 +00:00
Bharat Mediratta
e3d7877d79 Add @todos 2008-12-01 09:01:10 +00:00
Bharat Mediratta
91c4bda1ec Prototype access control model. There's much left to do, but it's a
working implementation.
2008-12-01 08:50:00 +00:00