Forward For WS
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"oc-auth/conf"
|
||||
"oc-auth/infrastructure/utils"
|
||||
"strings"
|
||||
|
||||
oclib "cloud.o-forge.io/core/oc-lib"
|
||||
"cloud.o-forge.io/core/oc-lib/tools"
|
||||
@@ -128,8 +129,12 @@ func (k KetoConnector) CreatePermission(permID string, relation string, internal
|
||||
if err != nil {
|
||||
return "", 422, err
|
||||
}
|
||||
k.BindPermission("admin", permID, "permits"+meth.String())
|
||||
return k.creates(permID, "permits"+meth.String(), k.scope())
|
||||
id, code, err := k.creates(permID, "permits"+meth.String(), k.scope())
|
||||
if err != nil && !strings.Contains(err.Error(), "already exist") {
|
||||
return id, code, err
|
||||
}
|
||||
k.BindPermission(conf.GetConfig().AdminRole, permID, "permits"+meth.String())
|
||||
return id, code, nil
|
||||
}
|
||||
|
||||
func (k KetoConnector) creates(object string, relation string, subject string) (string, int, error) {
|
||||
|
||||
Reference in New Issue
Block a user