Improved code sharing.
we now have a base url handler which handles listing, adding and editing any objects including permission management.
This commit is contained in:
37
apps/aqhome-storage/u_objects_p.h
Normal file
37
apps/aqhome-storage/u_objects_p.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/****************************************************************************
|
||||
* This file is part of the project AqHome.
|
||||
* AqHome (c) by 2023 Martin Preuss, all rights reserved.
|
||||
*
|
||||
* The license for this file can be found in the file COPYING which you
|
||||
* should have received along with this file.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef AQHOME_STORAGE_U_OBJECTS_P_H
|
||||
#define AQHOME_STORAGE_U_OBJECTS_P_H
|
||||
|
||||
|
||||
#include "./u_objects.h"
|
||||
|
||||
#include <gwenhywfar/stringlist.h>
|
||||
|
||||
|
||||
typedef struct AQH_URLHANDLER_OBJECTS AQH_URLHANDLER_OBJECTS;
|
||||
struct AQH_URLHANDLER_OBJECTS {
|
||||
uint32_t neededPermsList;
|
||||
uint32_t neededPermsAdd;
|
||||
uint32_t neededPermsDel;
|
||||
uint32_t neededPermsEdit; /* e.g. AQHOME_HTTP_PERMS_EDIT_ROOM */
|
||||
|
||||
char *urlForObjectList;
|
||||
|
||||
AQH_OBJECTSHTTPURLHANDLER_ADDOREDITOBJECT_FN addOrEditObjectFn;
|
||||
AQH_OBJECTSHTTPURLHANDLER_FINDOBJECTBYIDANDRETURNASDB_FN findObjectByIdAndReturnAsDbFn;
|
||||
AQH_OBJECTSHTTPURLHANDLER_WRITEADDPAGE_FN writeAddPageFn;
|
||||
AQH_OBJECTSHTTPURLHANDLER_WRITEEDITPAGE_FN writeEditPageFn;
|
||||
AQH_OBJECTSHTTPURLHANDLER_LISTOBJECTSINTOBUFFER_FN listObjectsIntoBufferFn;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user