/*
 * Artifact Keeper API
 *
 * Enterprise artifact registry supporting 45+ package formats.
 *
 * The version of the OpenAPI document: 1.2.1
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// PermissionsConfig : Fine-grained permissions enforcement status.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PermissionsConfig {
    /// Whether those rules are actively enforced on API requests. The permission-check middleware and handler guards are wired in, so this is `true` when the server is running.
    #[serde(rename = "enforcement_enabled")]
    pub enforcement_enabled: bool,
    /// Whether the permissions table (from migration 018) has any rows. When true, an administrator has configured permission rules.
    #[serde(rename = "rules_exist")]
    pub rules_exist: bool,
}

impl PermissionsConfig {
    /// Fine-grained permissions enforcement status.
    pub fn new(enforcement_enabled: bool, rules_exist: bool) -> PermissionsConfig {
        PermissionsConfig {
            enforcement_enabled,
            rules_exist,
        }
    }
}

