为用户添加Privilage

人气:834 发布:2022-09-22 标签: asp.net c# ASP.NET

问题描述

我有一个项目管理员必须为某些用户设置私密性,下面列出了一些特权: 1.查看/编辑/添加/删除表格内容等行为 2.查看特定菜单 另外我们需要检查是否登录的用户是管理员给予这样的特权 所以,PLease告诉DB结构使这成为可能 提前致谢

Hi, I have a Project in which Admins have to set privilage to some users, some privilages are listed below: 1.Actions like View/Edit/Add/Delete a Table Content 2.See Some Specific Menus Also we need to check whether the user logged in is an Admin to give such privilages So, PLease tell the DB structure to make this possible Thanks in advance

推荐答案

如果您只有四个权限添加/编辑/删除/查看,那么您可以创建表结构,如下所述: If you have only four permissions Add/Edit/Delete/View then you can create table structure as mentioned below :
User Table : 

Columns : 
	UserId (PK),
	UserName,
	FirstName,
	LastName,
	Password,
	IsAdmin (bool)


Modules Table : 

Columns :
	ModuleId (PK),
	Name,
	Description,
	

Priviledges Table :

Columns :
	PriviledgeId (PK),
	UserId (FK),
	ModuleId (FK),
	IsAdd (bool),
	IsView (bool),
	IsEdit (bool),
	IsDelete (bool)

注意:以上结构仅适用于基本功能。它可以根据要求

Note : Above structure is only for the basic functionality. It can be enhanced more as per the requirement

675