Browse Source

some more work on rbac

v0.1.8
Georg Hopp 12 years ago
parent
commit
7efb964040
  1. 15
      include/permission.h
  2. 23
      include/role.h

15
include/rbac/permission.h → include/permission.h

@ -20,8 +20,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef __RBAC_PERMIOSSION_H__
#define __RBAC_PERMIOSSION_H__
#ifndef __PERMISSION_H__
#define __PERMISSION_H__
#include <sys/types.h> #include <sys/types.h>
@ -29,12 +29,15 @@
#include "storage/storage.h" #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: // vim: set ts=4 sw=4:

23
include/rbac/role.h → include/role.h

@ -20,8 +20,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef __RBAC_ROLE_H__
#define __RBAC_ROLE_H__
#ifndef __ROLE_H__
#define __ROLE_H__
#include <sys/types.h> #include <sys/types.h>
@ -30,14 +30,23 @@
#include "storage/storage.h" #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: // vim: set ts=4 sw=4:
Loading…
Cancel
Save