Skip to content

Commit

Permalink
fix review
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperYoko committed Dec 26, 2022
1 parent 89d0317 commit c6f5a84
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/graph/service/PermissionCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace graph {
/**
* Read space : kUse, kDescribeSpace
* Write space : kCreateSpace, kDropSpace, kClearSpace, kCreateSnapshot,
* kDropSnapshot, kBalance, kAdmin, kConfig
* kDropSnapshot, kAdminJob(data balance), kConfig
* Read schema : kDescribeTag, kDescribeEdge,
* kDescribeTagIndex, kDescribeEdgeIndex
* Write schema : kCreateTag, kAlterTag, kCreateEdge,
Expand All @@ -24,7 +24,7 @@ namespace graph {
* kFetchEdges, kFindPath, kLimit, KGroupBy, kReturn
* Write data: kBuildTagIndex, kBuildEdgeIndex,
* kInsertVertex, kUpdateVertex, kInsertEdge,
* kUpdateEdge, kDeleteVertex, kDeleteEdges
* kUpdateEdge, kDeleteVertex, kDeleteEdges, kAdminJob(other)
* Special operation : kShow, kChangePassword
*/

Expand Down Expand Up @@ -117,8 +117,10 @@ namespace graph {
if (adminJobSentence == nullptr) {
// should not happend.
LOG(WARNING) << "sentence is not AdminJobSentence";
return Status::PermissionError("No permission to write space.");
return Status::PermissionError("Invalid adminjob sentence.");
}
// admin job like data balance need permission to write space
// here to restore default permission check before balance is refactored into job
if (adminJobSentence->needWriteSpace()) {
return PermissionManager::canWriteSpace(session);
}
Expand Down

0 comments on commit c6f5a84

Please sign in to comment.