Files
upstream-corteza/server/pkg/rbac/trace_test.go
upstream-mirror 7e385fc126
Some checks failed
SonarQube / SonarQube (push) Failing after 5m28s
E2e test on main branch push / server and client test (map[name:admin port:8080]) (push) Failing after 3m33s
Server and lib tests / Library test (js) (push) Failing after 1m36s
Server and lib tests / Library test (vue) (push) Successful in 2m24s
Server and lib tests / Web client test (admin) (push) Successful in 2m52s
Server and lib tests / Web client test (compose) (push) Successful in 3m23s
Server and lib tests / Web client test (discovery) (push) Successful in 2m49s
Server and lib tests / Web client test (one) (push) Successful in 2m52s
Server and lib tests / Web client test (privacy) (push) Successful in 2m44s
Server and lib tests / Web client test (reporter) (push) Successful in 2m56s
Server and lib tests / Web client test (workflow) (push) Successful in 3m0s
Server and lib tests / Server tests (push) Failing after 4m55s
E2e test on main branch push / notify-failure (push) Failing after 9s
Server and lib tests / Send matrix testing notification (push) Successful in 2s
Mark stale issues and pull requests / stale (push) Successful in 40s
snapshot of https://github.com/cortezaproject/corteza.git (2024.9.x, 2026-09-18; blobs > 131072B omitted)
2026-09-18 01:22:23 +05:00

61 lines
1.2 KiB
Go

package rbac
import (
"testing"
)
func TestEvaluate(t *testing.T) {
//var (
// rC1 = &Role{id: 1, kind: CommonRole}
// rAnon = &Role{id: 100, kind: AnonymousRole}
// rAuth = &Role{id: 200, kind: AuthenticatedRole}
// rCtx1 = &Role{id: 300, kind: ContextRole}
// rBps1 = &Role{id: 400, kind: BypassRole}
//
// allRoles = []*Role{rC1, rAnon, rAuth, rCtx1, rBps1}
// _ = allRoles
//
// res1 = "corteza::test:resource1"
//
// tcc = []struct {
// name string
// op string
// res string
// should Access
// roles []*Role
// rules RuleSet
// }{
// {
// name: "base",
// op: "READ",
// res: res1,
// roles: []*Role{rAuth},
// rules: RuleSet{
// &Rule{RoleID: rAuth.id, Resource: res1, Operation: "READ", Access: Allow},
// },
//
// should: Allow,
// },
// }
//)
//
//for _, tc := range tcc {
// t.Run(tc.name, func(t *testing.T) {
// var (
// req = require.New(t)
//
// partitionedRoles = partitionRoles(tc.roles...)
// indexedRules = indexRules(tc.rules)
//
// _access, _rule, _expl = evaluate(indexedRules, partitionedRoles, tc.op, tc.res, false)
// )
//
// _ = _access
// _ = _rule
// _ = _expl
//
// req.Equal(tc.should, _access)
// })
//}
}