package org.xyzh.common.dto.sys;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.xyzh.common.dto.BaseDTO;

/**
 * @description    ACL 策略表：定义对象类型的层级可见/可编辑规则
 * @filename    系统权限策略DTO
 * @author    yslg
 * @copyright yslg
 * @since 2025-11-02
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "系统访问控制策略DTO")
public class TbSysAclPolicyDTO extends BaseDTO {
    
    @Schema(description = "策略ID")
    private String policyId;
    
    @Schema(description = "策略名称")
    private String name;

    @Schema(description = "对象类型：article/file/course/..")
    private String objectType; 

    @Schema(description = "编辑层级规则：parent_only/parent_or_same_admin/owner_only/none")
    private String editHierarchyRule;

    @Schema(description = "可见层级规则 children_all/children_specified/none")
    private String viewHierarchyRule;

    @Schema(description = "默认权限（无显式ACL时应用）", defaultValue = "0")
    private Integer defaultPermission=0;

    @Schema(description = "默认是否允许", defaultValue = "true")
    private Boolean defaultAllow=true;
    
    @Schema(description = "是否默认应用到子级", defaultValue = "true")
    private Boolean applyToChildren=true;
}