PHP implements simple permission management

高洛峰
Release: 2023-03-02 21:02:01
Original
1816 people have browsed it

<?php
/*
权限设计
有一个全局的管理员root
每个栏目有个管理员权限为其他权限的合
每单个权限为2的倍数
list/read 1
add       2
edit      2
del       4
all       admin
*/
if( 5&2)
{
 echo 1;
}else{
 echo 0;
}
/*
简单的权限管理,有这个基本就够用了, 
不做更复杂的了,功能设计上不用考虑权限,
编码的遵循一些规范,在顶层类里,加个适配器
*/
?>
Copy after login


Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template