All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.security.fences.policy.AccessLevel Maven / Gradle / Ivy

There is a newer version: 1.9-beta
Show newest version
package com.google.security.fences.policy;

/**
 * An access control decision.
 */
public enum AccessLevel {
  // TODO: augment DISALLOWED to bundle human-readable text explaining why
  // access was/might-have-been denied.
  /** Access is not allowed. */
  DISALLOWED,
  /** Access is allowed. */
  ALLOWED,
  ;

  static AccessLevel mostRestrictive(AccessLevel... levels) {
    AccessLevel least = ALLOWED;
    for (AccessLevel level : levels) {
      if (level.compareTo(least) < 0) {
        least = level;
      }
    }
    return least;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy