blob: 315961d8a4eaae9d395bc05fab45e90158bf760a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#pragma once
#include "types.hpp"
#include "DataView.hpp"
#include "Permission.hpp"
#include <string>
#include <vector>
#include <stdexcept>
namespace odhtdb
{
class User;
class GroupNameTooLongException : public std::runtime_error
{
public:
GroupNameTooLongException(const std::string &groupName) :
std::runtime_error(std::string("The group name ") + groupName + " is longer than 255 bytes")
{
}
};
class Group
{
friend class User;
public:
Group(const std::string &name, uint8_t id[16], const Permission &permission);
~Group();
const std::string& getName() const;
DataView getId() const;
const Permission& getPermission() const;
const std::vector<const User*>& getUsers() const;
private:
void addUser(const User *user);
private:
std::string name;
uint8_t id[16];
Permission permission;
std::vector<const User*> users;
};
}
|