enh: check kill trans auth
This commit is contained in:
parent
612bdec1f7
commit
b38f18020d
|
@ -31,6 +31,7 @@ int32_t mndCheckDropUserAuth(SUserObj *pOperUser);
|
||||||
|
|
||||||
int32_t mndCheckNodeAuth(SUserObj *pOperUser);
|
int32_t mndCheckNodeAuth(SUserObj *pOperUser);
|
||||||
int32_t mndCheckFuncAuth(SUserObj *pOperUser);
|
int32_t mndCheckFuncAuth(SUserObj *pOperUser);
|
||||||
|
int32_t mndCheckTransAuth(SUserObj *pOperUser);
|
||||||
|
|
||||||
int32_t mndCheckCreateDbAuth(SUserObj *pOperUser);
|
int32_t mndCheckCreateDbAuth(SUserObj *pOperUser);
|
||||||
int32_t mndCheckAlterDropCompactDbAuth(SUserObj *pOperUser, SDbObj *pDb);
|
int32_t mndCheckAlterDropCompactDbAuth(SUserObj *pOperUser, SDbObj *pDb);
|
||||||
|
|
|
@ -74,10 +74,7 @@ static int32_t mndProcessAuthReq(SNodeMsg *pReq) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t mndCheckCreateUserAuth(SUserObj *pOperUser) {
|
int32_t mndCheckCreateUserAuth(SUserObj *pOperUser) {
|
||||||
if (pOperUser->superUser) {
|
if (pOperUser->superUser) return 0;
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
terrno = TSDB_CODE_MND_NO_RIGHTS;
|
terrno = TSDB_CODE_MND_NO_RIGHTS;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -118,28 +115,25 @@ int32_t mndCheckAlterUserAuth(SUserObj *pOperUser, SUserObj *pUser, SDbObj *pDb,
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t mndCheckDropUserAuth(SUserObj *pOperUser) {
|
int32_t mndCheckDropUserAuth(SUserObj *pOperUser) {
|
||||||
if (pOperUser->superUser) {
|
if (pOperUser->superUser) return 0;
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
terrno = TSDB_CODE_MND_NO_RIGHTS;
|
terrno = TSDB_CODE_MND_NO_RIGHTS;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t mndCheckNodeAuth(SUserObj *pOperUser) {
|
int32_t mndCheckNodeAuth(SUserObj *pOperUser) {
|
||||||
if (pOperUser->superUser) {
|
if (pOperUser->superUser) return 0;
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
terrno = TSDB_CODE_MND_NO_RIGHTS;
|
terrno = TSDB_CODE_MND_NO_RIGHTS;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t mndCheckFuncAuth(SUserObj *pOperUser) {
|
int32_t mndCheckFuncAuth(SUserObj *pOperUser) {
|
||||||
if (pOperUser->superUser) {
|
if (pOperUser->superUser) return 0;
|
||||||
return 0;
|
terrno = TSDB_CODE_MND_NO_RIGHTS;
|
||||||
}
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t mndCheckTransAuth(SUserObj *pOperUser) {
|
||||||
|
if (pOperUser->superUser) return 0;
|
||||||
terrno = TSDB_CODE_MND_NO_RIGHTS;
|
terrno = TSDB_CODE_MND_NO_RIGHTS;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1336,8 +1336,7 @@ static int32_t mndProcessKillTransReq(SNodeMsg *pReq) {
|
||||||
goto _OVER;
|
goto _OVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pUser->superUser) {
|
if (mndCheckTransAuth(pUser) != 0) {
|
||||||
terrno = TSDB_CODE_MND_NO_RIGHTS;
|
|
||||||
goto _OVER;
|
goto _OVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue