chmod method

Future<void> chmod(
  1. int userId,
  2. PlanMemberAccessType accessType
)

Modifies the access type of the member with the given userId.

Implementation

Future<void> chmod(int userId, PlanMemberAccessType accessType) async {
  if (!state.hasData) {
    log('Cannot modify member: No plan loaded.');

    return;
  }

  try {
    await _plan.chmod(
      _auth.state.requireData[Webservice.lb_planner_api],
      userId,
      accessType,
    );

    await captureEvent('member_access_changed', properties: {'access_type': accessType});

    await build(this);
  } catch (e, st) {
    log('Failed to modify member.', e, st);

    return;
  }
}