mode.go raw

   1  // Package mode provides a global ACL mode indicator that can be read by
   2  // packages that need to know the current access control mode without creating
   3  // circular dependencies.
   4  package mode
   5  
   6  import "next.orly.dev/pkg/utils/atomic"
   7  
   8  // ACLMode holds the current ACL mode as a string.
   9  // This is set by the ACL package when configured and can be read by other
  10  // packages (like database) to adjust their behavior.
  11  var ACLMode atomic.String
  12  
  13  // IsOpen returns true if the ACL mode is "none" (open relay mode).
  14  // In open mode, security filtering (expiration, deletion, privileged events)
  15  // should be disabled.
  16  func IsOpen() bool {
  17  	return ACLMode.Load() == "none"
  18  }
  19