NyAction class

Nylo's NyAction class

Constructors

NyAction()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

authorized(dynamic perform(), {required bool when(), dynamic unauthorized()?}) → dynamic
Perform an action only if the user is authorized to do so. Provide a perform function to execute if the user is authorized. Provide a when function to check if the user is authorized. Provide an unauthorized function to execute if the user is not authorized.
limitPerDay(String actionKey, dynamic perform(), {int maxPerDay = 5, dynamic unauthorized()?}) → dynamic
Limit the number of times an action can be performed in a day. Provide an actionKey for the action you want to limit. Provide an perform to execute if the user is authorized. Provide a maxPerDay to limit the number of times the action can be performed.