WHBANG commented on code in PR #1378:
URL:
https://github.com/apache/incubator-pegasus/pull/1378#discussion_r1127207056
##########
src/runtime/ranger/ranger_resource_policy.h:
##########
@@ -46,12 +47,18 @@ extern access_type operator|(access_type lhs, access_type
rhs);
extern access_type operator&(access_type lhs, access_type rhs);
+extern access_type &operator|=(access_type &lhs, access_type rhs);
+
+extern uint8_t access_type_to_int8_t(const access_type &ac_type);
+
// Ranger policy data structure
struct policy_item
{
- access_type access_types;
+ uint8_t access_types;
Review Comment:
For example: I need to store `access_type::KRead | access_type::KWrite` in
zk, but such a combination cannot be serialized correctly, it will be
serialized as `unknown`, if I deserialize it, it will lose `access_type::KRead
| access_type::KWrite` meaning, so I need to convert it to `uint8_t`.
mainly after c++11, it is recommended to use enum class. If it can handle
the logical relationship well, I think it is no problem. What do you think,
hope your reply
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]