UserCapabilitiesExtension extension

Provides helper methods for List<UserCapability>.

on

Properties

hasDev → bool
Returns true if UserCapability.dev is one of the capabilities the user has. Otherwise false.
read-only
hasModerator → bool
Returns true if the list contains UserCapability.moderator. Otherwise false.
read-only
hasStudent → bool
Returns true if the list contains UserCapability.student. Otherwise false.
read-only
hasTeacher → bool
Returns true if the list contains UserCapability.teacher. Otherwise false.
read-only
highest → UserCapability
Returns the highest UserCapability in the list.
read-only

Methods

has(List<UserCapability> capabilities) → bool
Returns true if the list contains all of the given capabilities. Otherwise false.