6.0.0-alpha12
6/8/25

[#2074] Turba::getAddressBooks ignoring permissions parameter
Summary Turba::getAddressBooks ignoring permissions parameter
Queue Turba
Queue Version HEAD
Type Bug
State Resolved
Priority 1. Low
Owners
Requester kevin_myer (at) iu13 (dot) org
Created 06/03/2005 (7310 days ago)
Due
Updated 06/09/2005 (7304 days ago)
Assigned 06/06/2005 (7307 days ago)
Resolved 06/06/2005 (7307 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
06/09/2005 11:18:09 PM kevin_myer (at) iu13 (dot) org Comment #9 Reply to this comment
The answer to that is to not give yourself (or anyone) PERMS_EDIT on
addressbooks that aren't actually editable.
Boy, its time I start digging a little deeper into Horde Permissions.   
I had _no_ idea that you could configure permissions on a source by 
source basis.  I didn't even know that a Sources option was available 
for Turba under the Permissions.    That essentially lets me create a 
small workgroup address book and just assign show/read/edit/delete to 
a few individuals or to a group.  Thats huge and I thought you had 
said in the past it couldn't be done..
06/09/2005 02:19:58 AM Chuck Hagenbuch Comment #8 Reply to this comment
I probably should have logged it as a separate issue, because I don't
know if permissions can handle it or not.  But I still have the
problem that if I have access to 23 address books, and all but one of
them are "readonly" (not in the sense of the old sources.php.dist
configuration but in the sense that I'm doing an anonymous bind, for
example), and I try to add a New Contact, I'm still shown all 23
addressbooks, even though I can only physically write to one.
The answer to that is to not give yourself (or anyone) PERMS_EDIT on 
addressbooks that aren't actually editable.
06/08/2005 02:48:27 AM kevin_myer (at) iu13 (dot) org Comment #7 Reply to this comment
Ok - thats also much simpler and cleaner to configure - all the 
options were getting confusing - do this, but don't do that, except if 
you want to do this and two wrongs will make a right :)



I probably should have logged it as a separate issue, because I don't 
know if permissions can handle it or not.  But I still have the 
problem that if I have access to 23 address books, and all but one of 
them are "readonly" (not in the sense of the old sources.php.dist 
configuration but in the sense that I'm doing an anonymous bind, for 
example), and I try to add a New Contact, I'm still shown all 23 
addressbooks, even though I can only physically write to one.



Kind of like being handed a whole stack of floppies - all but one has 
the tab clicked so you can't write to them.  And users, being users, 
will insert each floppy and try to save their work, until they find 
the one that doesn't have the write tab moved.  I'm not sure if I'm 
being clear or not, what the remaining issue is.
06/06/2005 02:55:41 AM Chuck Hagenbuch Comment #6
State ⇒ Resolved
Reply to this comment
I finally gave up looking at this and just removed the admin array and 
the readonly setting. Everything is done through the permissions 
system and ui now, exept for public, which is just used to say if a 
source holds one address book or many address books.
06/06/2005 01:26:14 AM kevin_myer (at) iu13 (dot) org Comment #5 Reply to this comment
Issue 1 is that for addressbooks which are marked readonly are still 
showing up in lists where they shouldn't (i.e. New Contact).  Users 
should never see lists of addressbooks to add to that are readonly.



Issue 2 is that I misunderstood readonly and thought that it dealt 
with the state of an addressbook (i.e. a readonly LDAP directory) 
versus PERM_EDIT.  So even if you have permissions to edit, its 
physically not possible.  The Auth::isAdmin check deals only with 
permissions and doesn't take into account whether you physically can 
edit the source and I was assuming that readonly meant the latter.  So 
as the documentation stands in prefs.php.dist, its a non-issue.
06/06/2005 12:44:36 AM Chuck Hagenbuch Comment #4
State ⇒ Feedback
Reply to this comment
I keep reading this and I can't find two distinct problems. You're 
testing this as an admin? What's the bug?
06/03/2005 06:48:14 PM kevin_myer (at) iu13 (dot) org Comment #3 Reply to this comment
Whoops - I just read the documentation for readonly in prefs.php and 
it clearly states there that readonly means readonly, except for 
admins.  I was assuming readonly meant it was physically not possible 
to write to that addressbook (as would be the case with a LDAP 
directory addressbook which only allowed anonymous bind access, for 
searching only).



So the second issue is not a bug, at least as prefs.php spells out how 
readonly works.  The initial logging of the ticket still is an issue 
though.
06/03/2005 06:16:36 PM kevin_myer (at) iu13 (dot) org Comment #2 Reply to this comment
Actually, I missed the return call to permissionsFilter, so I'm pretty 
sure the issue lies there.



There's a bug there too (I think):



             if (Auth::isAdmin()) {

                 return $in;

             }



should not return $in if the source is read-only (at least for a 
permission case of PERM_EDIT).
06/03/2005 05:58:29 PM kevin_myer (at) iu13 (dot) org Comment #1
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Turba::getAddressBooks ignoring permissions parameter
Queue ⇒ Turba
Reply to this comment
When you add a new contact to an addressbook, Turba::getAddressBooks 
is called with PERM_EDIT parameter.  However, that permission seems to 
be ignored, because the list of addressbooks you can add to that is 
returned is equal to whatever you have set for 'addressbooks'.  This 
means that one or more read-only addressbooks are being returned.   
Turba correctly returns an error when you try to save a contact in the 
read-only addressbooks but they should never be displayed as an option 
in the first place.

Saved Queries