Add Enforcer interface

This commit is contained in:
Ingo Oppermann 2023-05-25 10:29:55 +02:00
parent 10df8d51b1
commit 930b84b557
No known key found for this signature in database
GPG Key ID: 2AB32426E9DD229E
2 changed files with 6 additions and 2 deletions

View File

@ -16,7 +16,7 @@ import (
// The RestreamHandler type provides functions to interact with a Restreamer instance
type RestreamHandler struct {
restream restream.Restreamer
iam iam.IAM
iam iam.Enforcer
}
// NewRestream return a new Restream type. You have to provide a valid Restreamer instance.

View File

@ -5,8 +5,12 @@ import (
"github.com/datarhei/core/v16/log"
)
type IAM interface {
type Enforcer interface {
Enforce(name, domain, resource, action string) bool
}
type IAM interface {
Enforcer
HasDomain(domain string) bool
ListDomains() []string