Home > Backend Development > PHP Tutorial > php 实现简单的权限管理_PHP

php 实现简单的权限管理_PHP

WBOY
Release: 2016-06-01 12:30:26
Original
1159 people have browsed it

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

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