| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- /// 单据附件操作权限
- ///
- /// 来源: GET /OA/GetBillFileRights?billId=AE
- /// SPC_ID 格式: AE:1,1,1,1,1 (新增,下载,删除,查看,终审)
- class BillFileRights {
- final bool canAdd;
- final bool canDownload;
- final bool canDelete;
- final bool canView;
- final bool canFinalApprove;
- const BillFileRights({
- required this.canAdd,
- required this.canDownload,
- required this.canDelete,
- required this.canView,
- required this.canFinalApprove,
- });
- factory BillFileRights.fromJson(Map<String, dynamic> json) => BillFileRights(
- canAdd: json['canAdd'] == true,
- canDownload: json['canDownload'] == true,
- canDelete: json['canDelete'] == true,
- canView: json['canView'] == true,
- canFinalApprove: json['canFinalApprove'] == true,
- );
- /// 所有权限都为 false 的初始值
- static const none = BillFileRights(
- canAdd: false,
- canDownload: false,
- canDelete: false,
- canView: false,
- canFinalApprove: false,
- );
- /// 创建页:需要新增 + 查看权限
- bool get canManageAttachments => canAdd && canView;
- /// 详情页:需要查看 + 下载权限
- bool get canBrowseAttachments => canView && canDownload;
- }
|