code: public void grantDefaultPermissions(GroupValue groupValue) {
      PackageIdentity packageIdentity = new PackageIdentity(groupValue.getRootPackage().getName());
      GroupIdentity groupIdentity = new GroupIdentity(groupValue.getName());
      aclService.createAcl(groupIdentity);
      groupValue
          .getRoles()
          .forEach(
              roleValue -> {
                PermissionSet permissionSet = PERMISSION_SETS_PER_ROLE.get(roleValue.getLabel());
                Sid roleSid = createRoleSid(roleValue.getName());
                permissionService.grant(packageIdentity, permissionSet, roleSid);
                permissionService.grant(groupIdentity, permissionSet, roleSid);
              });
      if (groupValue.isPublic()) {
        permissionService.grant(groupIdentity, READ, createAuthoritySid(AUTHORITY_USER));
      }
    }
docs: Grants default permissions on the root package and group to the roles of the group
  
  @param groupValue details of the group for which the permissions will be granted