分类分类
关注+2009-07-10作者:
在数据库中新建2个表。PermissionItem表用于保存权限ID和页面路径的关系,一个权限ID可以有多个页面,一般同一个权限ID下的页面是为了实现同一个功能。PermissionList表用于保存用户所具有的权限。
- Code
- USE [UrlAuthorize]
- GO
- /****** Object: Table [dbo].[PermissionList] Script Date: 07/07/2009 00:07:10 ******/
- SET ANSI_NULLS ON
- GO
- SET QUOTED_IDENTIFIER ON
- GO
- CREATE TABLE [dbo].[PermissionList](
- [ID] [int] IDENTITY(1,1) NOT NULL,
- [PermissionID] [int] NOT NULL,
- [UserID] [int] NOT NULL,
- CONSTRAINT [PK_PermissionList] PRIMARY KEY CLUSTERED
- (
- [ID] ASC
- )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
- ) ON [PRIMARY]
- GO
- SET IDENTITY_INSERT [dbo].[PermissionList] ON
- INSERT [dbo].[PermissionList] ([ID], [PermissionID], [UserID]) VALUES (1, 2, 1)
- INSERT [dbo].[PermissionList] ([ID], [PermissionID], [UserID]) VALUES (2, 3, 1)
- SET IDENTITY_INSERT [dbo].[PermissionList] OFF
- /****** Object: Table [dbo].[PermissionItem] Script Date: 07/07/2009 00:07:10 ******/
- SET ANSI_NULLS ON
- GO
- SET QUOTED_IDENTIFIER ON
- GO
- SET ANSI_PADDING ON
- GO
- CREATE TABLE [dbo].[PermissionItem](
- [ID] [int] IDENTITY(1,1) NOT NULL,
- [PermissionID] [int] NOT NULL,
- [Name] [nvarchar](50) NOT NULL,
- [Route] [varchar](100) NOT NULL,
- CONSTRAINT [PK_PermissionItem] PRIMARY KEY CLUSTERED
- (
- [ID] ASC
- )WITH (PAD_INDEX =
相关文章
更多+相同厂商
热门推荐
点击查看更多
点击查看更多
点击查看更多
说两句网友评论