AdminPlugin<T extends User> class

Inheritance

Constructors

AdminPlugin()

Properties

dio ↔ Dio
latefinalinherited
fromJsonUser ↔ T Function(Map<String, dynamic> json)
latefinalinherited
getOptions Future<Options> Function({bool isTokenRequired})
latefinalinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tokenStore TokenStore
latefinalinherited

Methods

banUser({required String userId, String? banReason, int? banExpiresIn}) Future<BanUserResponse<T>>
Ban a user
createUser({required String email, required String password, required String name, String? role, Map<String, dynamic>? data}) Future<CreateUserResponse<T>>
Create a new user
hasPermission({required List<Map<String, dynamic>> permissions}) Future<SuccessResponse>
Check if a user has a permission
impersonateUser({required String userId}) Future<ImpersonateUserResponse<T>>
Impersonate a user
initialize({required Dio dio, required Future<Options> getOptions({bool isTokenRequired}), required TokenStore tokenStore, required T fromJsonUser(Map<String, dynamic> json)}) → void
inherited
listUsers({String? searchValue, String? searchField, SearchOperator? searchOperator, int? limit, int? offset, String? sortBy, String? sortDirection, String? filterField, String? filterOperator, String? filterValue}) Future<ListUsersResponse<T>>
List all users
listUserSessions({required String userId}) Future<ListUserSessionsResponse>
List all sessions for a user
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeUser({required String userId}) Future<SuccessResponse>
Delete a user and all their sessions and accounts. Cannot be undone.
removeUserSessions({required String userId}) Future<SuccessResponse>
Remove all sessions for a user
revokeUserSession({required String sessionToken}) Future<SuccessResponse>
Revoke a user session
setRole({required String userId, required String role}) Future<SetRoleResponse<T>>
Set the role of a user
setUserPassword({required String userId, required String newPassword}) Future<SuccessResponse>
Set the password of a user
stopImpersonating() Future<void>
Stop impersonating a user
toString() String
A string representation of this object.
inherited
unbanUser({required String userId}) Future<UnbanUserResponse<T>>
Unban a user
userHasPermission({String? userId, String? role, required List<Map<String, dynamic>> permissions}) Future<SuccessResponse>
Check if a user has a permission

Operators

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