first commit

This commit is contained in:
2025-01-09 11:57:41 +08:00
commit 700113c47b
47 changed files with 2050 additions and 0 deletions

17
acl_list.php Normal file
View File

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