chmod method

  1. @override
Future<void> chmod(
  1. String token,
  2. int userId,
  3. PlanMemberAccessType accessType
)
override

Modifies the access type of the member with the given userId in the plan of the user associated with the given token.

Implementation

@override
Future<void> chmod(String token, int userId, PlanMemberAccessType accessType) async {
  log('Changing access type of user $userId to $accessType');

  try {
    await _apiService.callFunction(
      function: 'local_lbplanner_plan_update_access',
      token: token,
      body: {
        'memberid': userId,
        'accesstype': accessType.index,
      },
    );

    log('Access type of user $userId changed to $accessType');
  } catch (e, s) {
    log('Failed to change access type of user $userId to $accessType', e, s);
    rethrow;
  }
}