我是一名正在开发与SharePoint有共同点的网站的学生。我使用ASP.NET MVC 3创建一个Intranet站点,以便人们可以通过Active Directory进行身份验证。我无法实现这些要求:
请帮帮我或给我一篇好文章的链接:)
答案 0 :(得分:0)
CREATE TABLE role
(
role NVARCHAR(50) NOT NULL PRIMARY KEY,
create BIT NOT NULL,
read BIT NOT NULL,
update BIT NOT NULL,
delete BIT NOT NULL
)
CREATE TABLE item
(
id INT NOT NULL PRIMARY KEY,
name NVARCHAR(50) NOT NULL,
id_parent INT,
CONSTRAINT FK_item_item FOREIGN KEY(id_parent) REFERENCES item(id)
)
CREATE TABLE user
(
id INT NOT NULL PRIMARY KEY,
adUserName NVARCHAR(50) NOT NULL,
role NVARCHAR(50) NOT NULL,
CONSTRAINT FK_user_role FOREIGN KEY(role) REFERENCES role(role)
)
CREATE TABLE user_item_rights
(
id_user INT NOT NULL,
id_item INT NOT NULL,
create BIT NOT NULL,
read BIT NOT NULL,
update BIT NOT NULL,
delete BIT NOT NULL,
CONSTRAINT PK_user_item_rights PRIMARY KEY(id_user,id_item),
CONSTRAINT FK_user_item_rights_user FOREIGN KEY(id_user) REFERENCES user(id),
CONSTRAINT FK_user_item_rights_item FOREIGN KEY(id_item) REFERENCES item(id)
)
这应该让您了解如何实现这一点。您也可以将其翻译成课程。您还可以实现CRUD继承,或者定义role_item_right表。 在我的想法中,user_item_rights会覆盖角色中的默认设置。