22 lines
530 B
Go
22 lines
530 B
Go
package rbac
|
|
|
|
import "dealroom/internal/model"
|
|
|
|
// IsSeller returns true if role is owner or admin
|
|
func IsSeller(role string) bool {
|
|
return role == "owner" || role == "admin"
|
|
}
|
|
|
|
// IsBuyer returns true if role is viewer or member
|
|
func IsBuyer(role string) bool {
|
|
return role == "viewer" || role == "member"
|
|
}
|
|
|
|
// BuyerGroups returns the buyer groups for the demo buyer
|
|
func BuyerGroups(profile *model.Profile) []string {
|
|
if IsBuyer(profile.Role) {
|
|
return []string{"Meridian Capital", "Summit Health Equity"}
|
|
}
|
|
return nil
|
|
}
|