isMemberOfGroup function

bool isMemberOfGroup(
  1. String group
)

Returns true if the owner of this process is a member of group.

Implementation

bool isMemberOfGroup(String group) {
  core.verbose(() => 'isMemberOfGroup: $group');

  if (Settings().isWindows) {
    throw UnsupportedError(
      'isMemberOfGroup is not Not currently supported on windows',
    );
  }
  // get the list of groups this user belongs to.
  final groups = 'groups'.firstLine!.split(' ');

  // is the user a member of the file's group.
  return groups.contains(group);
}