...
1 package rulesengine
2
3 import (
4 "context"
5 )
6
7
8 func (reng RulesEngine) GetEARolesForCommand(ctx context.Context, command Command, bannerID string) ([]string, error) {
9 return reng.ds.EARoles(ctx, bannerID, command)
10 }
11
12
13
14 func (reng RulesEngine) UserHasRoles(_ string, eaRoles []string, userEARoles []string) bool {
15 for _, earole := range eaRoles {
16 for _, userEARole := range userEARoles {
17 if earole == userEARole {
18 return true
19 }
20 }
21 }
22 return false
23 }
24
View as plain text