Chore: Fix error handling in postDashboard, remove UserDisplayDTO, fix live redis client initialization (#87206)
* clean up error handling in postDashboard and remove UserDisplayDTO * replace GetUserUID with GetUID and GetNamespacedUID, enforce namespace constant type * lint fix * lint fix * more lint fixes
This commit is contained in:
@@ -136,10 +136,9 @@ func (f *accessControlDashboardPermissionFilter) buildClauses() {
|
||||
folderWildcards := accesscontrol.WildcardsFromPrefix(dashboards.ScopeFoldersPrefix)
|
||||
|
||||
userID := int64(0)
|
||||
namespaceID, identifier := f.user.GetNamespacedID()
|
||||
switch namespaceID {
|
||||
case identity.NamespaceUser, identity.NamespaceServiceAccount:
|
||||
userID, _ = identity.IntIdentifier(namespaceID, identifier)
|
||||
namespace, identifier := f.user.GetNamespacedID()
|
||||
if namespace == identity.NamespaceUser || namespace == identity.NamespaceServiceAccount {
|
||||
userID, _ = identity.IntIdentifier(namespace, identifier)
|
||||
}
|
||||
|
||||
orgID := f.user.GetOrgID()
|
||||
|
||||
@@ -34,10 +34,9 @@ func (f *accessControlDashboardPermissionFilterNoFolderSubquery) buildClauses()
|
||||
folderWildcards := accesscontrol.WildcardsFromPrefix(dashboards.ScopeFoldersPrefix)
|
||||
|
||||
userID := int64(0)
|
||||
namespaceID, identifier := f.user.GetNamespacedID()
|
||||
switch namespaceID {
|
||||
case identity.NamespaceUser, identity.NamespaceServiceAccount:
|
||||
userID, _ = identity.IntIdentifier(namespaceID, identifier)
|
||||
namespace, identifier := f.user.GetNamespacedID()
|
||||
if namespace == identity.NamespaceUser || namespace == identity.NamespaceServiceAccount {
|
||||
userID, _ = identity.IntIdentifier(namespace, identifier)
|
||||
}
|
||||
|
||||
orgID := f.user.GetOrgID()
|
||||
|
||||
Reference in New Issue
Block a user