Auth: Shorten code comments in pkg/clean/scope.go #98 #5230

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2025-09-26 05:55:50 +02:00
parent bd66110c18
commit 66e2027c10

View File

@@ -6,7 +6,7 @@ import (
"github.com/photoprism/photoprism/pkg/list" "github.com/photoprism/photoprism/pkg/list"
) )
// Scope sanitizes a string that contains authentication scope identifiers. // Scope sanitizes a string that contains auth scope identifiers.
// Callers should use acl.ScopeAttrPermits / acl.ScopePermits for authorization checks. // Callers should use acl.ScopeAttrPermits / acl.ScopePermits for authorization checks.
func Scope(s string) string { func Scope(s string) string {
if s == "" { if s == "" {
@@ -16,7 +16,7 @@ func Scope(s string) string {
return list.ParseAttr(strings.ToLower(s)).String() return list.ParseAttr(strings.ToLower(s)).String()
} }
// Scopes sanitizes authentication scope identifiers and returns them as string slice. // Scopes sanitizes auth scope identifiers and returns them as strings.
// Callers should use acl.ScopeAttrPermits / acl.ScopePermits for authorization checks. // Callers should use acl.ScopeAttrPermits / acl.ScopePermits for authorization checks.
func Scopes(s string) []string { func Scopes(s string) []string {
if s == "" { if s == "" {