isAuthorized method

bool isAuthorized([
  1. UserId? userId
])

Returns authorization status of the MyUser identified by the provided UserId, if userId is non-null, or of the active MyUser otherwise.

Implementation

bool isAuthorized([UserId? userId]) {
  if (userId == null || userId == credentials.value?.userId) {
    return _hasAuthorization;
  }

  return accounts[userId]?.value != null;
}