16 #ifndef IOX_UTILS_POSIX_WRAPPER_ACCESS_CONTROL_HPP
17 #define IOX_UTILS_POSIX_WRAPPER_ACCESS_CONTROL_HPP
19 #include "iceoryx_utils/cxx/optional.hpp"
20 #include "iceoryx_utils/cxx/string.hpp"
21 #include "iceoryx_utils/cxx/vector.hpp"
22 #include "iceoryx_utils/platform/acl.hpp"
28 #include <type_traits>
50 #if defined(QNX) || defined(QNX__) || defined(__QNX__)
51 enum class Category : std::underlying_type<acl_tag_t>::type
59 GROUP = ACL_GROUP_OBJ,
66 #if defined(QNX) || defined(QNX__) || defined(__QNX__)
67 enum class Permission : std::underlying_type<acl_perm_t>::type
74 READWRITE = Permission::READ | Permission::WRITE,
98 using smartAclPointer_t = std::unique_ptr<std::remove_pointer<acl_t>::type, std::function<void(acl_t)>>;
100 struct PermissionEntry
102 unsigned int m_category;
109 smartAclPointer_t createACL(
const int32_t f_numEntries)
const;
110 bool createACLEntry(
const acl_t f_ACL,
const PermissionEntry& f_entry)
const;
111 bool addAclPermission(acl_permset_t f_permset, acl_perm_t f_perm)
const;
113 bool m_useACLMask{
false};
string implementation with some adjustments in the API, because we are not allowed to throw exception...
Definition: string.hpp:86
abstraction class for the management of access control lists (ACLs).
Definition: access_control.hpp:42
Category
identifier for a permission entry (user, group, others, ...)
Definition: access_control.hpp:55
@ SPECIFIC_GROUP
a specific group must be identified by a name
@ SPECIFIC_USER
a specific user must be identified by a name
bool addPermissionEntry(const Category f_category, const Permission f_permission, const string_t &f_name)
just like addPermissionEntry(Category, Permission, int) but using a name instead of an id.
bool writePermissionsToFile(const int32_t f_fileDescriptor) const
Write permission entries stored by the AccessController to a file identified by a file descriptor.
bool addPermissionEntry(const Category f_category, const Permission f_permission, const uint32_t f_id=-1u)
define and store a specific permission entry to be used by writePermissionsToFile.
static constexpr int32_t MaxNumOfPermissions
maximum number of permission entries the AccessController can store
Definition: access_control.hpp:47
Permission
access right for a permission entry
Definition: access_control.hpp:71
building block to easily create free function for logging in a library context
Definition: lockfree_queue.hpp:28