fromEntityPlus static method

Future<AccessModel?> fromEntityPlus(
  1. String documentID,
  2. AccessEntity? entity, {
  3. String? appId,
})

Implementation

static Future<AccessModel?> fromEntityPlus(
    String documentID, AccessEntity? entity,
    {String? appId}) async {
  if (entity == null) return null;

  return AccessModel(
    documentID: documentID,
    appId: entity.appId ?? '',
    privilegeLevel: toPrivilegeLevel(entity.privilegeLevel),
    points: entity.points,
    blocked: entity.blocked,
    privilegeLevelBeforeBlocked:
        toPrivilegeLevelBeforeBlocked(entity.privilegeLevelBeforeBlocked),
  );
}