// Path: fiat-core/src/main/java/com/netflix/spinnaker/fiat/model/Authorization.java
// public enum Authorization {
//   READ,
//   WRITE,
//   EXECUTE,
//   CREATE;
// 
//   public static final Set<Authorization> ALL =
//       Collections.unmodifiableSet(EnumSet.allOf(Authorization.class));
// }


import com.netflix.spinnaker.fiat.model.Authorization;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
   * permissions.
   */
  @SuppressWarnings("unchecked")
  public <T extends BaseAccessControlled> T setRequiredGroupMembership(List<String> membership) {
    if (membership == null || membership.isEmpty()) {
      return (T) this;
    }

    if (getPermissions() != null && getPermissions().isRestricted()) {
      String msg =
          String.join(
              " ",
              "`requiredGroupMembership` found on",
              getResourceType().toString(),
              getName(),
              "and ignored because `permissions` are present");
      log.warn(msg);
      return (T) this;
    }

    String msg =
        String.join(
            " ",
            "Deprecated `requiredGroupMembership` found on",
            getResourceType().toString(),
            getName(),
            ". Please update to `permissions`.");
    log.warn(msg);
    this.setPermissions(
        new Permissions.Builder()
// Path: fiat-core/src/main/java/com/netflix/spinnaker/fiat/model/Authorization.java
// public enum Authorization {
//   READ,
//   WRITE,
//   EXECUTE,
//   CREATE;
// 
//   public static final Set<Authorization> ALL =
//       Collections.unmodifiableSet(EnumSet.allOf(Authorization.class));
// }


// Path: fiat-core/src/main/java/com/netflix/spinnaker/fiat/model/resources/BaseAccessControlled.java
import com.netflix.spinnaker.fiat.model.Authorization;
import java.util.List;
import lombok.extern.slf4j.Slf4j;

   * permissions.
   */
  @SuppressWarnings("unchecked")
  public <T extends BaseAccessControlled> T setRequiredGroupMembership(List<String> membership) {
    if (membership == null || membership.isEmpty()) {
      return (T) this;
    }

    if (getPermissions() != null && getPermissions().isRestricted()) {
      String msg =
          String.join(
              " ",
              "`requiredGroupMembership` found on",
              getResourceType().toString(),
              getName(),
              "and ignored because `permissions` are present");
      log.warn(msg);
      return (T) this;
    }

    String msg =
        String.join(
            " ",
            "Deprecated `requiredGroupMembership` found on",
            getResourceType().toString(),
            getName(),
            ". Please update to `permissions`.");
    log.warn(msg);
    this.setPermissions(
        new Permissions.Builder()
            .add(Authorization.READ, membership)