You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

18 lines
384 B

package mock
import (
"context"
"tera-clone/services/tera-api/internal/domain"
)
func logPortVisible(ctx context.Context, channel string) bool {
actor, ok := domain.ActorFromContext(ctx)
if !ok {
return true
}
access := actor.PortAccess
if access == nil {
access = defaultPortAccessForRole(actor.Role)
}
return access[channel] == "read" || access[channel] == "write"
}