-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhance: add CreateRole, DropRole, GrantRole, RevokeRole, DescribeRol…
…e and ListRoles Signed-off-by: Ruichen Bao <ruichen.bao@zju.edu.cn>
- Loading branch information
Showing
7 changed files
with
235 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "milvus/types/RoleDesc.h" | ||
|
||
namespace milvus { | ||
|
||
RoleDesc::RoleDesc() {} | ||
|
||
RoleDesc::RoleDesc(const std::string& role, const std::vector<Privilege>& privileges) | ||
: role_(role), privileges_(privileges) {} | ||
|
||
const std::string& RoleDesc::GetRole() const { | ||
return role_; | ||
} | ||
|
||
const std::vector<Privilege>& RoleDesc::GetPrivileges() const { | ||
return privileges_; | ||
} | ||
|
||
} // namespace milvus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
namespace milvus { | ||
|
||
struct Privilege { | ||
std::string object_type; | ||
std::string object_name; | ||
std::string db_name; | ||
std::string role_name; | ||
std::string privilege; | ||
std::string grantor_name; | ||
}; | ||
|
||
class RoleDesc { | ||
public: | ||
RoleDesc(); | ||
RoleDesc(const std::string& role, const std::vector<Privilege>& privileges); | ||
|
||
const std::string& GetRole() const; | ||
const std::vector<Privilege>& GetPrivileges() const; | ||
|
||
private: | ||
std::string role_; | ||
std::vector<Privilege> privileges_; | ||
}; | ||
|
||
} // namespace milvus |