mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-04 10:21:40 +00:00
fix: Add service to database when registering
This commit is contained in:
committed by
Prad Nukala (aider)
parent
1810ee1c7f
commit
861fbf501d
@@ -1,7 +1,5 @@
|
||||
package types
|
||||
|
||||
import "gopkg.in/macaroon-bakery.v2/bakery/checkers"
|
||||
|
||||
var (
|
||||
PermissionScopeStrings = [...]string{
|
||||
"profile.name",
|
||||
@@ -36,18 +34,3 @@ var (
|
||||
"PERMISSION_SCOPE_ADMIN_VALIDATOR": PermissionScope_PERMISSION_SCOPE_ADMIN_VALIDATOR,
|
||||
}
|
||||
)
|
||||
|
||||
func ResolvePermissionScope(scope string) (PermissionScope, bool) {
|
||||
uriToPrefix := make(map[string]string)
|
||||
for _, scope := range PermissionScopeStrings {
|
||||
uriToPrefix["https://example.com/auth/"+scope] = scope
|
||||
}
|
||||
PermissionNamespace := checkers.NewNamespace(uriToPrefix)
|
||||
|
||||
prefix, ok := PermissionNamespace.Resolve("https://example.com/auth/" + scope)
|
||||
if !ok {
|
||||
return 0, false
|
||||
}
|
||||
permScope, ok := StringToPermissionScope[prefix]
|
||||
return permScope, ok
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user