diff --git a/include/rbac/permission.h b/include/permission.h similarity index 81% rename from include/rbac/permission.h rename to include/permission.h index 39d4815..fc91627 100644 --- a/include/rbac/permission.h +++ b/include/permission.h @@ -20,8 +20,8 @@ * along with this program. If not, see . */ -#ifndef __RBAC_PERMIOSSION_H__ -#define __RBAC_PERMIOSSION_H__ +#ifndef __PERMISSION_H__ +#define __PERMISSION_H__ #include @@ -29,12 +29,15 @@ #include "storage/storage.h" -CLASS(RbacPermission) { - char * name; - size_t nname; +CLASS(Permission) { + char id[37]; + unsigned long hash; + + char * resource; + int action; }; -#endif // __RBAC_PERMIOSSION_H__ +#endif // __PERMISSION_H__ // vim: set ts=4 sw=4: diff --git a/include/rbac/role.h b/include/role.h similarity index 69% rename from include/rbac/role.h rename to include/role.h index 348f006..7e19a2d 100644 --- a/include/rbac/role.h +++ b/include/role.h @@ -20,8 +20,8 @@ * along with this program. If not, see . */ -#ifndef __RBAC_ROLE_H__ -#define __RBAC_ROLE_H__ +#ifndef __ROLE_H__ +#define __ROLE_H__ #include @@ -30,14 +30,23 @@ #include "storage/storage.h" -CLASS(RbacRole) { - char * name; - size_t nname; +CLASS(Role) { + char id[37]; + unsigned long hash; - RbacPermission * permissions; + char * name; + size_t nname; + + /** + * \todo We need a good way to serialize a hash. + * If I can't find any I should choose a different + * data structure here...but I think there is a way. + */ + Hash permissions; + Hash users; }; -#endif // __RBAC_ROLE_H__ +#endif // __ROLE_H__ // vim: set ts=4 sw=4: