package roles

const (
	Admin     = "admin"
	Author    = "author"
	Organizer = "organizer"
	User      = "user"
)

var AllRoles = []string{
	Admin,
	Author,
	Organizer,
	User,
}

type IHasRole interface {
	HasRole(role string) bool
}

func HasRole(claims IHasRole, role string) bool {
	if claims.HasRole(Admin) {
		return true
	}

	return claims.HasRole(role)
}
