summaryrefslogtreecommitdiffstats
path: root/database/eurephiadb_driver.h
diff options
context:
space:
mode:
Diffstat (limited to 'database/eurephiadb_driver.h')
-rw-r--r--database/eurephiadb_driver.h61
1 files changed, 27 insertions, 34 deletions
diff --git a/database/eurephiadb_driver.h b/database/eurephiadb_driver.h
index 2976a41..57b51e0 100644
--- a/database/eurephiadb_driver.h
+++ b/database/eurephiadb_driver.h
@@ -693,57 +693,50 @@ xmlDoc *(*eDBadminUserCertsLink) (eurephiaCTX *ctx, xmlDoc *usrcrt_xml);
/**
- * Retrieve a list over all users granted access to the administration utilities
+ * List, grant or revoke access to the administration utilities
*
* @version API version level 2
* @param ctx eurephiaCTX
- * @param srch_xml XML document specifying the search query.
- *
- * Search XML document skeleton:
- * @code
- * <eurephia format="1">
- * <admin_access>
- * <fieldMapping table="eurephia_adminaccess">
- * <{search field}>{search value}</{search field}>
- * </fieldMapping>
- * </admin_access>
- * </eurephia>
- * @endcode
- * Valid field names are: uid, interface, access
- * It can be several search field tags to narrow the search even more.
- *
- * @return Returns a valid XML document with the result on success, otherwise NULL.
- * @see eurephiaXML_CreateDoc(), eurephiaXML_getRoot()
- */
-xmlDoc *(*eDBadminGetAdminAccess) (eurephiaCTX *ctx, xmlDoc *srch_xml);
-
-
-/**
- * Add or delete access to the administration utilities
- *
- * @version API version level 2
- * @param ctx eurephiaCTX
- * @param grant_xml XML document with the operation and information.
+ * @param qryxml XML document with the operation and information.
*
* XML format skeleton for grant_xml
* @code
* <eurephia format="1">
- * <edit_admin_access mode="{grant|revoke}">
+ * <admin_access mode="{list|grant|revoke}">
* <fieldMapping table="eurephia_adminaccess">
* <uid>{user id}</uid>
* <interface>{C|W}</uid>
* <accesslevel>{access level string}</accesslevel>
* </fieldMapping>
- * </edit_admin_access>
+ * </admin_access>
* </eurephia>
* @endcode
- * To grant access, all fields are needed. For bulk revokes, some fields can be skipped.
+ * To grant or revoke access, all fields are needed. For list mode, any given fields will narrow
+ * the database query. If no fields are given to list mode, all registered records will be returned.
* The interface tag can have two valid values, C for console interface and W for web interface.
*
- * @return Returns 1 on success, otherwise 0 or -1
- * @see eurephiaXML_CreateDoc()
+ * XML format used for list mode:
+ * @code
+ * <eurephia format="1">
+ * <admin_access_list>
+ * <user_access>
+ * <username uid="{uid}">{username}</username>
+ * <access_levels>
+ * <access interface="{interface}">{access level string}</access>
+ * ... (more access tags)
+ * ...
+ * </access_levels>
+ * </user_access>
+ * ... (another user_access tag)
+ * </admin_access_list>
+ * </eurephia>
+ * @endcode
+ *
+ * @return Returns a valid eurephia XML document with the result of success or failure.
+ * On fatal errors NULL is returned.
+ * @see eurephiaXML_CreateDoc(), eurephiaXML_getRoot()
*/
-int (*eDBadminEditAdminAccess) (eurephiaCTX *ctx, xmlDoc *grant_xml);
+xmlDoc *(*eDBadminAccessLevel) (eurephiaCTX *ctx, xmlDoc *qryxml);
/**