mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #2407 from ioito/hotfix/qx-metadata-rbac-fix
fix: 避免admin=false时,不显示其余项目下的标签信息
This commit is contained in:
@@ -163,7 +163,7 @@ func (manager *SMetadataManager) ListItemFilter(ctx context.Context, q *sqlchemy
|
||||
prefix := sqlchemy.NewStringField(fmt.Sprintf("%s::", man.Keyword()))
|
||||
field := sqlchemy.CONCAT(man.Keyword(), prefix, resourceView.Field("id"))
|
||||
sq := resourceView.Query(field)
|
||||
if !admin || !IsAllowList(rbacutils.ScopeSystem, userCred, man) {
|
||||
if !admin && !IsAllowList(rbacutils.ScopeSystem, userCred, man) {
|
||||
sq = man.FilterByOwner(sq, userCred, man.ResourceScope())
|
||||
}
|
||||
conditions = append(conditions, sqlchemy.In(q.Field("id"), sq))
|
||||
|
||||
Reference in New Issue
Block a user