常見模組設計 許可權管理(auth)

2021-10-09 14:49:17 字數 1362 閱讀 9353

drop table if exists tky_auth_role;

create table tky_auth_role (

roleid mediumint (8) unsigned not null auto_increment comment '編號',

title char (30) not null default '' comment '名稱',

status tinyint (1) not null default '1' comment '狀態',

rules text comment '規則',

primary key (roleid)

) engine=innodb default charset=utf8 comment = '角色';

drop table if exists tky_auth_role_member;

create table tky_auth_role_member (

uid mediumint (8) unsigned not null default '0' comment '使用者編號',

roleid mediumint (8) unsigned not null default '0' comment '組編號',

unique key uid_role_id (uid, roleid)

) engine=innodb default charset=utf8 comment = '使用者角色';

drop table if exists tky_auth_rule;

create table tky_auth_rule (

ruleid mediumint (8) unsigned not null auto_increment comment '編號',

module varchar (20) not null default '' comment '規則所屬module',

type tinyint (1) not null default '1' comment '型別 1-url;2-主選單',

name char (80) not null default '' comment '規則唯一英文標識',

title char (20) not null default '' comment '規則中文描述',

regex char (100) not null default '' comment '規則表示式',

status tinyint (1) not null default '1' comment '狀態',

primary key (ruleid)

) engine=innodb default charset=utf8 comment = '規則表';

常見模組設計 OA許可權管理設計

oa系統許可權管理設計方案 不同職責的人員,對於系統操作的許可權應該是不同的。優秀的業務系統,這是最基本的功能。可以對 組 進行許可權分配。對於乙個大企業的業務系統來說,如果要求管理員為其下員工逐一分配系統操作許可權的話,是件耗時且不夠方便的事情。所以,系統中就提出了對 組 進行操作的概念,將許可權...

常見模組設計 許可權管理(一)

1.基於 rbac role based access control 許可權訪問控制。也就是說乙個使用者可以有多個角色,乙個角色可以有多個許可權,通過將角色和許可權分離開來提高設計的可擴充套件性,通常乙個使用者有多個角色,乙個角色也會屬於多個使用者 多對多 乙個角色有多個許可權,乙個許可權也會屬於...

常見模組設計 許可權管理(二)

許可權設計 基於角色的許可權設計 這種方案是最常見也是比較簡單的方案,不過通常有這種設計已經夠了,所以微軟就設計出這種方案的通用做法,這種方案對於每乙個操作不做控制,只是在程式中根據角色對是否具有操作的許可權進行控制 這裡我們就不做詳述 許可權設計 基於操作的許可權設計 這種模式下每乙個操作都在資料...