1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-16 04:24:56 +02:00

internal/types/blacklist.go: add BlacklistWildcard constant

This commit is contained in:
Henrik Hautakoski 2024-12-04 15:15:22 +01:00
parent eb2032e233
commit 2006da6a19

View file

@ -1,5 +1,7 @@
package types
const BlacklistWildcard = "*"
type Blacklist struct {
table map[string][]string
isWhitelist bool
@ -42,9 +44,9 @@ func (bl Blacklist) list(contracts ...string) [][]string {
}
func (bl Blacklist) IsAllowed(contract string, action string) bool {
for _, v := range bl.list(contract, "*") {
for _, v := range bl.list(contract, BlacklistWildcard) {
for _, act := range v {
if act == action || act == "*" {
if act == action || act == BlacklistWildcard {
return bl.isWhitelist == true
}
}