fix(unified-storage): remove permissions after executing on both stores (#109722)
Signed-off-by: Maicon Costa <maiconscosta@gmail.com> Co-authored-by: Jean-Philippe Quéméner <jeanphilippe.quemener@grafana.com>
This commit is contained in:
co-authored by
Jean-Philippe Quéméner
parent
79f4510260
commit
5270d8e53f
@@ -0,0 +1,20 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
type folderRemovePermissions string
|
||||
|
||||
const removePermissionKey = folderRemovePermissions("RemovePermission")
|
||||
|
||||
func SetFolderRemovePermissions(ctx context.Context, value bool) context.Context {
|
||||
return context.WithValue(ctx, removePermissionKey, value)
|
||||
}
|
||||
|
||||
func GetFolderRemovePermissions(ctx context.Context, defaultVal bool) bool {
|
||||
if val, ok := ctx.Value(removePermissionKey).(bool); ok {
|
||||
return val
|
||||
}
|
||||
return defaultVal
|
||||
}
|
||||
Reference in New Issue
Block a user