withOtherPrivilege method

  1. @override
Future<AccessDetermined> withOtherPrivilege(
  1. AccessBloc accessBloc,
  2. AppModel app,
  3. PrivilegeLevel privilege,
  4. bool blocked,
)
override

Implementation

@override
Future<AccessDetermined> withOtherPrivilege(AccessBloc accessBloc,
    AppModel app, PrivilegeLevel privilege, bool blocked) async {
  var newAccesses = await AccessHelper.extendAccesses2(
      accessBloc, member, accesses, app, true, privilege, blocked);
  var newApps = apps.map((v) => v).toList();
  newApps.removeWhere((element) => element.app.documentID == app.documentID);

  var homePage = await getHomepage(app, blocked, privilege);
  newApps.add(DeterminedApp(app, homePage));

  return Future.value(LoggedIn._(
    usr,
    member,
    postLoginAction,
    newApps,
    newAccesses,
    subscribedToApps,
    blockedMembers,
    playstoreApp: playstoreApp,
    newForceRefresh: forceRefresh,
  ));
}