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
-
Perform an action only if the user is authorized to do so.
Provide a
performfunction to execute if the user is authorized. Provide awhenfunction to check if the user is authorized. Provide anunauthorizedfunction to execute if the user is not authorized. -
limitPerDay(
String actionKey, dynamic perform(), {int maxPerDay = 5, dynamic unauthorized()?}) → Future< void> -
Limit the number of times an action can be performed in a day.
Provide an
actionKeyfor the action you want to limit. Provide anperformto execute if the user is authorized. Provide amaxPerDayto limit the number of times the action can be performed.