18 lines
467 B
Go
18 lines
467 B
Go
package domain
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"git.cin.su/m/Assistant/contracts/identity"
|
|
)
|
|
|
|
var ErrInvalidCreatorBinding = errors.New("creator actor and principal binding must be explicit and active")
|
|
|
|
// ValidateCreatorBinding makes the Creator's two semantic roles explicit.
|
|
func ValidateCreatorBinding(binding identity.PrincipalBinding) error {
|
|
if binding.ActorID == "" || binding.PrincipalID == "" || !binding.Active {
|
|
return ErrInvalidCreatorBinding
|
|
}
|
|
return nil
|
|
}
|