f
This commit is contained in:
16
internal/application/product/self_subscribe_policy.go
Normal file
16
internal/application/product/self_subscribe_policy.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package product
|
||||
|
||||
import "context"
|
||||
|
||||
// SelfSubscribePolicy 是否允许用户在控制台自助发起「订阅产品」
|
||||
type SelfSubscribePolicy interface {
|
||||
Allow(ctx context.Context, userID string) (allowed bool, message string, err error)
|
||||
}
|
||||
|
||||
// DefaultAllowSelfSubscribe 未装配下属模块时:恒允许
|
||||
type DefaultAllowSelfSubscribe struct{}
|
||||
|
||||
// Allow 恒允许
|
||||
func (DefaultAllowSelfSubscribe) Allow(_ context.Context, _ string) (bool, string, error) {
|
||||
return true, "", nil
|
||||
}
|
||||
Reference in New Issue
Block a user