1 // UserSecurityContext.h 2 3 #ifndef NET_FS_USER_SECURITY_CONTEXT_H 4 #define NET_FS_USER_SECURITY_CONTEXT_H 5 6 #include "Permissions.h" 7 8 #include <Node.h> 9 10 class User; 11 12 class UserSecurityContext { 13 public: 14 UserSecurityContext(); 15 ~UserSecurityContext(); 16 17 status_t Init(User* user); 18 19 User* GetUser() const; 20 21 status_t AddNode(dev_t volumeID, ino_t nodeID, 22 Permissions permissions); 23 24 Permissions GetNodePermissions(dev_t volumeID, 25 ino_t nodeID) const; 26 Permissions GetNodePermissions(const node_ref& ref) const; 27 Permissions GetNodePermissions(dev_t volumeID, ino_t nodeID, 28 Permissions parentPermissions) const; 29 Permissions GetNodePermissions(const node_ref& ref, 30 Permissions parentPermissions) const; 31 32 private: 33 struct PermissionMap; 34 35 User* fUser; 36 PermissionMap* fPermissions; 37 }; 38 39 #endif // NET_FS_USER_SECURITY_CONTEXT_H 40