Access.h
Go to the documentation of this file.
1 
23 #pragma once
24 
25 #include "UserRole.h"
26 
27 namespace IFS
28 {
29 /*
30  * Role-based Access Control List.
31  *
32  * We only require two entries to explicitly define read/write access.
33  */
34 struct ACL {
35  /* Minimum access permissions */
38 
39  bool operator==(const ACL& other) const
40  {
41  return other.readAccess == readAccess && other.writeAccess == writeAccess;
42  }
43 
44  bool operator!=(const ACL& other) const
45  {
46  return !operator==(other);
47  }
48 };
49 
50 static_assert(sizeof(ACL) == 2, "ACL is misaligned");
51 
58 String getAclString(const IFS::ACL& acl);
59 
60 } // namespace IFS
61 
67 String toString(const IFS::ACL& acl);
bool operator==(const ACL &other) const
Definition: Access.h:39
The String class.
Definition: WString.h:136
Definition: DirectoryTemplate.h:36
bool operator!=(const ACL &other) const
Definition: Access.h:44
String toString(const IFS::ACL &acl)
Return a descriptive textual representation for an ACL.
UserRole readAccess
Definition: Access.h:36
UserRole
Definition: UserRole.h:36
Definition: Access.h:34
String getAclString(const IFS::ACL &acl)
Return a brief textual representation for an ACL Suitable for inclusion in a file listing...
UserRole writeAccess
Definition: Access.h:37