下文为您列举的五张表是在创建SQL角色与权限时需要用到的,如果您在创建SQL角色等方面遇到过问题,不妨一看,对您会有所启迪。
创新互联专注于韶关网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供韶关营销型网站建设,韶关网站制作、韶关网页设计、韶关网站官网定制、微信小程序开发服务,打造韶关网络公司原创品牌,更为您提供韶关网站排名全网营销落地服务。
创建SQL角色与权限要用到五张数据库表:
1,SQL用户信息表
- create table employee
- (
- userid varchar(50) not null, --用户ID
- username varchar(100), --用户名
- userpassword varchar(100), --密码
- ..
- ..
- ..
- ..
- )
- alter table employee --主键
- add constraint pk_employee_userid primary key (userid)
2,SQL角色表
- create table role
- (
- roleid varchar(50) not null, --角色Id
- rolename varchar(100), --角色名称
- )
- alter table tole --主键
- add constraint pk_role_roleid primary key (roleid)
3,SQL权限表
- create table popedom
- (
- popedomid int identity(1,1) not null, --权限Id
- popedomname varchar(100), --权限名称
- popedomfatherid int, --权限父ID
- popedomurl varchar(100) --树的连接路径
- ..
- ..
- )
- er table popedom --主键
- add constraint PK_popedom primary key (popedomid)
添加数据如
insert into popedom values('我的办公桌',0,'')
insert into popedom values('电子邮箱',1,'../mail/EmaiolManage.aspx')
(添加数据的原则是一级接点的popedomfatherid 为0,如果是(我的办公桌)下面的接点,它们的popedomfatherid为(我的办公桌)的主键)
4,用户与角色关系表
- create table user_role
- (
- connectionid int identity(1,1) not null, --关系ID
- userid varchar(50) not null, --管理员表ID
- roleid varchar(50) not null --角色Id
- )
- alter table user_role --主键
- add constraint PK_admin_role primary key(connectionid)
5,角色与权限关系表
- create table role_popedom --角色与权限表
- (
- connectionid int identity(1,1), --关系Id
- roleid varchar(50) not null, --角色ID
- popedomid int not null, --权限Id
- popedom int --权限 (1为可用,2为不可用)
- )
- alter table role_popedom --主键
- add constraint PK_role_popedom primary key(connectionid) --主键
文章题目:创建SQL角色与权限用到的五个数据库表
路径分享:http://www.csdahua.cn/qtweb/news44/41444.html
网站建设、网络推广公司-快上网,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 快上网