package enum

// PermissionType separates backend-admin permissions from frontend-user
// menu permissions; it is informational (UI only) and does not affect
// Casbin enforcement.
type PermissionType string

const (
	PermissionTypeBackendUser  PermissionType = "backend_user"
	PermissionTypeFrontendUser PermissionType = "frontend_user"
)

// IsValid reports whether t is a known permission type.
func (t PermissionType) IsValid() bool {
	switch t {
	case PermissionTypeBackendUser, PermissionTypeFrontendUser:
		return true
	default:
		return false
	}
}

// String returns the raw type value.
func (t PermissionType) String() string {
	return string(t)
}
