新建文件

This commit is contained in:
2025-01-06 19:52:30 +08:00
commit 4d2d5e2d5e
32 changed files with 1177 additions and 0 deletions

17
acl_list.php Normal file
View File

@ -0,0 +1,17 @@
<?php
// 定义 ACL 表
$acl = array(
"cto" => array("r_1.php", "r_2.php", "r_3.php"),
"manager" => array("r_2.php", "r_3.php"),
"staff" => array("r_3.php")
);
// 定义检查权限的函数
function checkAccess($role, $resource) {
global $acl;
if (isset($acl[$role]) && in_array($resource, $acl[$role])) {
return true; // 有权限
}
return false; // 无权限
}