求PHP网站靠山管理 管理员 权限控制 系统方案
求PHP网站后台管理 管理员 权限控制 系统方案
小弟现在做一个网站后台,包括文章上传模块,供下载的文件上传,用户留言模块等。
问题:后台管理员权限分配
说明:现在系统有一个超级管理员,具有所有权限。现在想实现:超级管理员可以添加一般管理员,并且可以控制一般管理员的权限。比如控制某个一般用户只能上传文章,而不能上传图片等等,这该如何实现?求个思路,有源码实例更好啦!
另外,系统可能新增加其他模块(比如新增一个 图片上传模块等等),在新增了后台模块后,如何方便的配置原有管理员账号关于新增模块的相关权限?
可能说的不太清楚,有问题欢迎跟帖!
最高只能给100分,不知能不能加分了!
------解决方案--------------------
每个权限都需要加一个标记。
如:
发布贴子 1
添加管理员 2
图片上传 3
...........
如用户具备已上三个权限
存记数据库,是数组,(1;2;3)
用户只具备发布贴子权限 (2;)
具备发布贴子和图片上传权限 (2;3;)
...........
判断是否助有权限时,查找是否包含就行。。
不知我是明白??
------解决方案--------------------
建立一个模块表。如果对该模块有操作权利,为1.否则.0
1 0 1 1.很灵活的使用
------解决方案--------------------
建立一个模块表,模快表里面有个admin_group_id,记录那些是管理员可以看到的,那些是用户的..那一目了然比如
用户模快 1,3 --1表示最高管理员,3表示用户
上传模块 1,2 --1表示最高管理员,2表示一般管理员
------解决方案--------------------
建立一个模块表,模快表里面有个admin_group_id,记录那些是管理员可以看到的,那些是用户的..那一目了然比如
用户模快 1,3 --1表示最高管理员,3表示用户
上传模块 1,2 --1表示最高管理员,2表示一般管理员
------解决方案--------------------
phpgacl
------解决方案--------------------
------解决方案--------------------
上面的多是简单权限
复杂的看权限角色模型,网上搜一下
------解决方案--------------------
使用组很方便
组表:
组id/组名
1/组1
2/组2
…………
权限表:
权限id/权限名
1/权限1
2/权限2
3/权限3
…………
组 权限关联表:
组id/权限id
1/1
1/2
2/2
2/4
…………
随意搭配,组1可能就是你的超管,组2是普管,你新建个组3,搭配一下,就是普通用户。新建组4,可能就是受限用户
------解决方案--------------------
看看dedecms的权限管理吧 我就是模仿的那种 我觉得非常灵活
------解决方案--------------------
------解决方案--------------------
我前两天也在弄这个权限问题,
自己设计了几个表
在zend auth下面使用的,搂主可以参考一下
/*角色表
-- id
-- 用户名
-- 密码
-- 工作组 A,B,C...
*/
DROP TABLE IF EXISTS role_acl;
CREATE TABLE role_acl (
id int(11) NOT NULL auto_increment,
username varchar(30) NOT NULL,
password varchar(20) NOT NULL,
work_group char(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=gbk;
/*工作组
-- id
-- 工作组 A,B,C...
-- 文字描述
*/
DROP TABLE IF EXISTS group_acl;
CREATE TABLE group_acl (
id int(11) NOT NULL auto_increment,
work_group char(1) NOT NULL,
group_desc varchar(60) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=gbk;
/* 角色 资源 动作 映射表
-- id
-- 工作组 A,B,C...
-- 资源代码
*/
DROP TABLE IF EXISTS mapped_acl;
CREATE TABLE mapped_acl (
id int(11) NOT NULL auto_increment,
work_group varchar(1) NOT NULL,
resource varchar(20) NOT NULL,
action varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=gbk;

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



When logging into iTunesStore using AppleID, this error saying "This AppleID has not been used in iTunesStore" may be thrown on the screen. There are no error messages to worry about, you can fix them by following these solution sets. Fix 1 – Change Shipping Address The main reason why this prompt appears in iTunes Store is that you don’t have the correct address in your AppleID profile. Step 1 – First, open iPhone Settings on your iPhone. Step 2 – AppleID should be on top of all other settings. So, open it. Step 3 – Once there, open the “Payment & Shipping” option. Step 4 – Verify your access using Face ID. step

If you find event ID 55, 50, 140 or 98 in the Event Viewer of Windows 11/10, or encounter an error that the disk file system structure is damaged and cannot be used, please follow the guide below to resolve the issue. What does Event 55, File system structure on disk corrupted and unusable mean? At session 55, the file system structure on the Ntfs disk is corrupted and unusable. Please run the chkMSK utility on the volume. When NTFS is unable to write data to the transaction log, an error with event ID 55 is triggered, which will cause NTFS to fail to complete the operation unable to write the transaction data. This error usually occurs when the file system is corrupted, possibly due to the presence of bad sectors on the disk or the file system's inadequacy of the disk subsystem.

In Alibaba software, once you successfully register an account, the system will assign you a unique ID, which will serve as your identity on the platform. But for many users, they want to query their ID, but don't know how to do it. Then the editor of this website will bring you detailed introduction to the strategy steps below. I hope it can help you! Where can I find the answer to Alibaba ID: [Alibaba]-[My]. 1. First open the Alibaba software. After entering the homepage, we need to click [My] in the lower right corner; 2. Then after coming to the My page, we can see [id] at the top of the page; Alibaba Is the ID the same as Taobao? Alibaba ID and Taobao ID are different, but the two
![Event ID 4660: Object deleted [Fix]](https://img.php.cn/upload/article/000/887/227/168834320512143.png?x-oss-process=image/resize,m_fill,h_207,w_330)
Some of our readers encountered event ID4660. They're often not sure what to do, so we explain it in this guide. Event ID 4660 is usually logged when an object is deleted, so we will also explore some practical ways to fix it on your computer. What is event ID4660? Event ID 4660 is related to objects in Active Directory and will be triggered by any of the following factors: Object Deletion – A security event with Event ID 4660 is logged whenever an object is deleted from Active Directory. Manual changes – Event ID 4660 may be generated when a user or administrator manually changes the permissions of an object. This can happen when changing permission settings, modifying access levels, or adding or removing people or groups

Where can I check the Tencent Video ID? There is an exclusive ID in the Tencent Video APP, but most users do not know how to check the Tencent Video ID. Next is the graphic tutorial on how to check the Tencent Video ID brought by the editor for users who are interested. Users come and take a look! Tencent Video Usage Tutorial Where to check Tencent Video ID 1. First open the Tencent Video APP and enter the special area through [Personal Center] in the lower right corner of the main page; 2. Then enter the Personal Center page and select the [Settings] function; 3. Then go to Settings page, click [Exit Account] at the bottom; 4. Finally, you can view the exclusive ID number on the page shown below.

The difference between null and NULL in C language is: null is a macro definition in C language, usually used to represent a null pointer, which can be used to initialize pointer variables, or to determine whether the pointer is null in a conditional statement; NULL is a macro definition in C language A predefined constant in , usually used to represent a null value, used to represent a null pointer, null pointer array or null structure pointer.

Vue cannot obtain the id attribute because getElementById is used in the "created()" hook function, and Vue has not completed mounting; the solution is to "created() {let serachBox = document.getElementById('searchBox') ;...}" code can be migrated to the "mounted()" hook function.

In JavaScript, both undefined and null represent the concept of "nothing": 1. undefined represents an uninitialized variable or a non-existent property. When a variable is declared but no value is assigned to it, the value of the variable is undefined , when accessing properties that do not exist in the object, the returned value is also undefined; 2. null represents an empty object reference. In some cases, the object reference can be set to null to release the memory it occupies.
