diff --git a/source/dnode/mnode/impl/src/mndConsumer.c b/source/dnode/mnode/impl/src/mndConsumer.c index c7ae36b02c..e8458a2fdc 100644 --- a/source/dnode/mnode/impl/src/mndConsumer.c +++ b/source/dnode/mnode/impl/src/mndConsumer.c @@ -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); diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c index e4767d72d7..f8a79c8522 100644 --- a/source/dnode/mnode/impl/src/mndStream.c +++ b/source/dnode/mnode/impl/src/mndStream.c @@ -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}; diff --git a/source/dnode/mnode/impl/src/mndTopic.c b/source/dnode/mnode/impl/src/mndTopic.c index 0d23db09e5..de543f4256 100644 --- a/source/dnode/mnode/impl/src/mndTopic.c +++ b/source/dnode/mnode/impl/src/mndTopic.c @@ -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;