Merge pull request #24777 from taosdata/feat/TD-27463-3.0
fix: grant check for stream/topic/subscription
This commit is contained in:
commit
ffedfbaf1e
|
@ -552,11 +552,6 @@ int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
|
|||
char *msgStr = pMsg->pCont;
|
||||
int32_t code = -1;
|
||||
|
||||
if ((terrno = grantCheck(TSDB_GRANT_SUBSCRIPTION)) < 0) {
|
||||
code = terrno;
|
||||
return code;
|
||||
}
|
||||
|
||||
SCMSubscribeReq subscribe = {0};
|
||||
tDeserializeSCMSubscribeReq(msgStr, &subscribe);
|
||||
|
||||
|
|
|
@ -634,7 +634,7 @@ static int32_t mndProcessCreateStreamReq(SRpcMsg *pReq) {
|
|||
terrno = TSDB_CODE_SUCCESS;
|
||||
|
||||
if ((terrno = grantCheck(TSDB_GRANT_STREAMS)) < 0) {
|
||||
goto _OVER;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
SCMCreateStreamReq createReq = {0};
|
||||
|
|
|
@ -564,6 +564,10 @@ static int32_t mndProcessCreateTopicReq(SRpcMsg *pReq) {
|
|||
return code;
|
||||
}
|
||||
|
||||
if ((terrno = grantCheck(TSDB_GRANT_SUBSCRIPTION)) < 0) {
|
||||
return code;
|
||||
}
|
||||
|
||||
if (tDeserializeSCMCreateTopicReq(pReq->pCont, pReq->contLen, &createTopicReq) != 0) {
|
||||
terrno = TSDB_CODE_INVALID_MSG;
|
||||
goto _OVER;
|
||||
|
|
Loading…
Reference in New Issue