Commit Graph

19 Commits

Author SHA1 Message Date
Tim Almdal
4edf86f0eb Revert "Fix for ticket #452"
This reverts commit 809e52d80c.
2009-07-27 11:14:03 -07:00
Tim Almdal
5fd82a2ede Back out the fix for ticket #452
Revert "Changed access::user_can to force the owner of an item to have"

This reverts commit 0b97cfd6f0.
2009-07-27 11:13:20 -07:00
Tim Almdal
1ec1f19f1a Back out fixes for ticket #452
Revert "It helps to save before committing :-)"

This reverts commit 0d76d6fd77.
2009-07-27 11:12:27 -07:00
Andy Staudacher
570e0b0267 Merge branch 'master' of git://github.com/rledisez/gallery3 into rledisez/master 2009-07-26 22:45:53 -07:00
Tim Almdal
0d76d6fd77 It helps to save before committing :-) 2009-07-26 09:33:44 -07:00
Tim Almdal
0b97cfd6f0 Changed access::user_can to force the owner of an item to have
view permission on the parent. Added a whitelist of allowable
owner permissions.

If the requested permission is view and the user requesting access
is the owner, check that they have view permission to the parent.
2009-07-26 09:29:29 -07:00
Tim Almdal
809e52d80c Fix for ticket #452
1) Change access_Core::user_can to return true for all permissions if the
   owner is the specified user.
2) Change Item_Model::viewable to set the owner_id is the first view_restriction
   This allowed simplification of the generating the where clause to a single
   $this->orwhere instead of a where and an orwhere.
2009-07-25 23:45:48 -07:00
Romain LE DISEZ
23bb6eb7e3 Rename columns that use reserved SQL words : items.left and items.right 2009-07-25 19:06:54 +02:00
Bharat Mediratta
7f1a7ead58 Fix a typo in a comment 2009-07-23 09:24:33 -07:00
Romain LE DISEZ
7c7d4c0ec0 Consistency : always use self::XXX
(cherry picked from commit c9017ae2f2)
2009-07-23 09:12:08 -07:00
Romain LE DISEZ
350c1b0267 Use BOOLEAN instead of integer to describe the permissions :
- DENY = false
 - ALLOW = true
 - UNKNOW = null  (for intent only)
 - INHERIT = null (for cache)

Upgrade is not included for now.
(cherry picked from commit 719c59e040)
2009-07-23 09:11:55 -07:00
Tim Almdal
85ed445e23 remove an extra ->reload() that was there for testing 2009-07-22 15:20:30 -07:00
Tim Almdal
d4104a23ec Add explicit unit tests for access::user_can 2009-07-22 15:16:56 -07:00
Tim Almdal
4ddaaeb9dd Duh... when I added user_can, I passed in the user, but still used the groups from the session 2009-07-22 09:39:22 -07:00
Tim Almdal
f533aee1cc Add an API method user_can that allows for checking a specific user has the
specified permission to the item.  Changed can to delegate to this method
passing in the active user.
2009-07-21 15:52:46 -07:00
Bharat Mediratta
cd907c2b42 Change model_cache::clear() API to clear everything. This prevents
old ORM relationships from hanging around, which was causing problems
when doing MPTT manipulations (resulting in incorrect permission
propagation-- very bad!)
2009-07-17 12:51:27 -07:00
Bharat Mediratta
8a6556b30b Fix a bug where moved items don't properly inherit permissions from
their new target.  After each move, recalculate the permissions for
the new parent's hierarchy.

Fixes ticket #552
2009-07-17 08:14:08 -07:00
Bharat Mediratta
88a3d43ba9 Update all references to the core application to now point to the
gallery module.  This type of mass update is prone to some small bugs.
2009-05-27 16:17:29 -07:00
Bharat Mediratta
28b41056e3 Restructure things so that the application is now just another module.
Kohana makes this type of transition fairly straightforward in that
all controllers/helpers/etc are still located in the cascading
filesystem without any extra effort, except that I've temporarily
added a hack to force modules/gallery into the module path.

Rename what's left of "core" to be "application" so that it conforms
more closely to the Kohana standard (basically, just
application/config/config.php which is the minimal thing that you need
in the application directory)

There's still considerable work left to be done here.
2009-05-27 15:07:27 -07:00