[commits] [Wiki] changed: HordeGroupAPI

Ben Klang ben at alkaloid.net
Sun Jan 30 17:10:28 UTC 2011


bklang  Sun, 30 Jan 2011 12:10:28 -0500

Modified page: http://wiki.horde.org/HordeGroupAPI
New Revision:  1.10
Change log:  More refactoring plans

@@ -41,12 +41,14 @@

  +++ renameGroup($gid, $newName)

  Changes the name of a group without affecting its membership list
+Should probably be private.  This method exists for the instantiated  
Horde_Group objects to perform backend operations.  Application code  
should work with Horde_Group objects.

  +++ removeGroup($gid)

  Removes a group from the groups system permanently.
+Should probably be private.  This method exists for the instantiated  
Horde_Group objects to perform backend operations.  Application code  
should work with Horde_Group objects.

  +++ getByName($name)

  Returns a Horde_Group object based on $name
@@ -85,106 +87,31 @@

  Add a user to a group.

  * Should be able to handle arrays for both parameters.
+Should probably be private.  This method exists for the instantiated  
Horde_Group objects to perform backend operations.  Application code  
should work with Horde_Group objects.

-+++ @@+++ removeUser($username, $gid) @@
++++ removeUser($username, $gid)

  Remove a user from a group.
+Should probably be private.  This method exists for the instantiated  
Horde_Group objects to perform backend operations.  Application code  
should work with Horde_Group objects.

  * Should be able to handle arrays for both parameters.


-+++ @@--- newGroup($name, $parent = DATATREE_ROOT) @@
+++ Horde_Group

-deprecated in favor of using addGroup()
+This object represents a group

-+++ @@--- getGroup($gid) @@
++++ id()

-deprecated -- no longer using group objects.
++++ addUser($username)

-+++ @@--- getGroupById($gid) @@
++++ removeUser($username)

-deprecated -- no longer using group objects.
++++ listUsers($recurse = true)

-Note: This is used in a (small) number of places, most important  
among those is probably the Horde base API.  There are a couple  
methods, (
-addGroupPermissions(), removeGroupPermissions()) which use it.  This  
brings up a greater point: We probably want to have a way to allow  
external entities to interact with our groups via the API methods.   
However this probably necessitates a way to look up group IDs (rather  
than requiring them to know our internal Group IDs).  I believe this  
method can be done correctly, but it does need to be better defined.   
Today, the DataTree driver allows passing in a Groups object, an  
array, or a string.  The array is join()ed with ':' to produce a  
string which is used to look up the Group ID.  Whatever happens, we  
must be able to design method which does not have an ambiguous return  
value.
++++ delete()

-+++ @@--- getGroupShortName($group) @@
++++ rename()

-deprecated -- no need for short names...they're just confusing (K.I.S.S)
-
-+++ @@--- getGroupId($group) @@
-
-deprecated -- no longer using group objects.
-
-+++ @@--- getGroupParents($gid) @@
-
-deprecated in favor of always using flat lists.
-
-+++ @@--- getGroupParentList($gid) @@
-
-deprecated in favor of getGroupParent()
-
-+++ @@--- listAllUsers($gid) @@
-
-deprecated in favor of listUsers()
-
-+++ @@--- getLevel($gid) @@
-
-deprecated -- This is only used in the group admin UI for the tree.   
Horde_Tree automatically determines node depth now, so this is no  
longer necessary.
-
-+++ @@--- updateGroup($group) @@
-
-deprecated -- All group modifications are saved to the backend on the fly.
-
-+++ @@--- getAuditLog($gid) @@
-
-deprecated -- Only used internally to store group to backend.
-
-+++ @@--- clearAuditLog($gid) @@
-
-deprecated -- Only used internally to store group to backend.
-
-
-++ @@--- !DatatreeObject_Group @@
-
-All !DatatreeObject_Group functionality has been moved to Group  
(Horde_Groups) to eliminate OO overhead.
-
-+++ setGroupOb(&$groupOb)
-
-+++ getId()
-
-+++ save()
-
-+++ addUser($username, $update = true)
-
-+++ removeUser($username, $update = true)
-
-+++ listUser()
-
-+++ listAllUsers()
-
-+++ getAuditLog()
-
-+++ clearAuditLog()
-
-----
-
-++ Horde_Groups API
-
-This is a list of the methods that will be available in Horde_Groups  
to Horde4 applications:
-
-* addGroup($name, $parent)
-* removeGroup($gid)
-* renameGroup($gid, $newName)
-* getGroupname($gid)
-* getGUID($gid)
-* exists($gid)
-* getGroupParent($gid, $deep = false)
-* listGroups()
-* listUsers($gid, $subgroups = false)
-* getGroupMembership($username, $parents = false)
-* userIsInGroup($username, $gid, $subgroups = true)
-* addUser($username, $gid)
-* removeUser($username, $gid)




More information about the commits mailing list