From cc4180b27d1bf3d100cc327c15527e1299bafd79 Mon Sep 17 00:00:00 2001 From: zhuyu Date: Wed, 4 Jun 2025 10:17:35 +0800 Subject: [PATCH] feature: auth --- application/admin/controller/oa/CustomSchedule.php | 5 ++++- application/admin/lang/zh-cn/{ => oa}/custom_schedule.php | 0 2 files changed, 4 insertions(+), 1 deletion(-) rename application/admin/lang/zh-cn/{ => oa}/custom_schedule.php (100%) diff --git a/application/admin/controller/oa/CustomSchedule.php b/application/admin/controller/oa/CustomSchedule.php index b8ea402..666b874 100644 --- a/application/admin/controller/oa/CustomSchedule.php +++ b/application/admin/controller/oa/CustomSchedule.php @@ -22,6 +22,9 @@ class CustomSchedule extends Backend */ protected $model = null; + protected $noNeedRight = ['editable']; + + public function _initialize() { parent::_initialize(); @@ -97,7 +100,7 @@ class CustomSchedule extends Backend ->where('date', '>=', $startDate) ->where('date', '<=', $endDate); - if (!$this->auth->isSuperAdmin()) { + if (!$this->auth->check('oa/custom_schedule/edit')) { $builder = $builder->where('exec_admin_id', $this->auth->id); } diff --git a/application/admin/lang/zh-cn/custom_schedule.php b/application/admin/lang/zh-cn/oa/custom_schedule.php similarity index 100% rename from application/admin/lang/zh-cn/custom_schedule.php rename to application/admin/lang/zh-cn/oa/custom_schedule.php