[dev] Permission check problems (always true)
Andre Pawlowski
sqall at h4des.org
Sat Feb 28 14:07:56 UTC 2009
Michael Rubinsky wrote:
>
> This is Perms::hasPermission() - you were calling
> Registry::hasPermission() - two different beasts.
>
Oh, you are right. I didn't see it.
>> But when I take a look to the contact.php of Turba, there the
>> function is called:
>>
>> $contact->hasPermission(PERMS_EDIT)
>>
>> And it works fine there.
>
> ...and this is yet another class' hasPermission method, probably
> Turba_Object::hasPermission(). Your comparing apples to oranges to
> bananas.
Yeah, now I see my failure. I take a look at methods of the wrong class.
> Well, the way you check permissions depends on what your checking the
> permissions on, and how your application is structured. Some
> applications use Horde_Share, where each object, like a calendar
> (Kronolith) or a Photo Album (Ansel) is represented by a Share object,
> and all permissions are granted/checked through the Share object.
> Shares allow the share (calendar/photo album/etc...) owner to set
> permissions themselves so they can decide who sees their resources.
> Other applications, like Whups (bug/issue tracking) and Chora (source
> code repository viewer) control all permissions via the administrative
> permissions interface. An administrator must make all changes via this
> interface. These permissions are checked via the various Perms::
> methods. The Registry method that you originally asked about is,
> AFAICT, only used when building the sidebar and the top menu - when
> it's used to determine the visibility of the various applications for
> the current user.
I just want the administrator to set permissions for read/write to a
group of users and my application check the permissions when it does an
read/write specific action (in my case upload/download). For this I need
to know what kind of method/function I must/can use to check the
permission.
First of all I will take a look at the hasPermission() functions in the
different classes.
I'm still upset with myself that I didn't see that the methods belong to
different classes -_-
Thanks
--
Andre Pawlowski
-------------------------------------------------------------------
Amerikas Verbündete müssen bei jedem neuen Präsidenten lernen, was für die nächsten vier oder acht Jahre das Gute und das Böse ist - ein anstrengender Prozess.
-Carl Friedrich von Weizsäcker
More information about the dev
mailing list