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
performcallback to execute if the user is authorized. Provide awhencallback to check if the user is authorized. Provide anunauthorizedcallback to execute if the user is not authorized. -
limitPerDay(
String actionKey, FutureOr< void> perform(), {int maxPerDay = 5, FutureOr<void> 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 aperformcallback to execute if the user is authorized. Provide amaxPerDayto limit the number of times the action can be performed. Provide anunauthorizedcallback to execute if the limit is reached.