實(shí)現(xiàn)權(quán)限要求數(shù)據(jù)庫(kù)結(jié)構(gòu)如下:
創(chuàng)新互聯(lián)公司專(zhuān)注于企業(yè)全網(wǎng)營(yíng)銷(xiāo)推廣、網(wǎng)站重做改版、東風(fēng)網(wǎng)站定制設(shè)計(jì)、自適應(yīng)品牌網(wǎng)站建設(shè)、H5頁(yè)面制作、成都商城網(wǎng)站開(kāi)發(fā)、集團(tuán)公司官網(wǎng)建設(shè)、外貿(mào)營(yíng)銷(xiāo)網(wǎng)站建設(shè)、高端網(wǎng)站制作、響應(yīng)式網(wǎng)頁(yè)設(shè)計(jì)等建站業(yè)務(wù),價(jià)格優(yōu)惠性價(jià)比高,為東風(fēng)等各大城市提供網(wǎng)站開(kāi)發(fā)制作服務(wù)。
用戶表(id,用戶名,密碼,角色id)
角色表(id,角色名,權(quán)限id)
權(quán)限表(id,權(quán)限名,鏈接地址)
不能。 權(quán)限問(wèn)題就是這么嚴(yán)格執(zhí)行的。如果你沒(méi)有權(quán)限就讓你去訪問(wèn)那么必然就成了微軟的漏洞了哦。
試試用你同樣的賬號(hào)密碼在可視化數(shù)據(jù)管理器中可以連接到SQL數(shù)據(jù)庫(kù)不?可能是賬號(hào)的權(quán)限問(wèn)題。需要聯(lián)系SQL服務(wù)器管理員索要權(quán)限。
'
' 需要添加以下命名空間:
' Imports System.IO
' Imports System.Security.AccessControl
' */
Dim sPath As String = Server.MapPath(文件夾名稱(chēng)字符串)
Directory.CreateDirectory(sPath)
addpathPower(sPath, "ASPNET", "FullControl")
'////////////////////////////////////////////////
Public Sub addpathPower(ByVal pathname As String, ByVal username As String, ByVal power As String)
Dim dirinfo As DirectoryInfo = New DirectoryInfo(pathname)
If (dirinfo.Attributes FileAttributes.ReadOnly) 0 Then
dirinfo.Attributes = FileAttributes.Normal
End If
'取得訪問(wèn)控制列表
Dim dirsecurity As DirectorySecurity = dirinfo.GetAccessControl()
Select Case power
Case "FullControl"
dirsecurity.AddAccessRule(New FileSystemAccessRule(uername,FileSystemRights.FullControl,InheritanceFlags.ContainerInherit,PropagationFlags.InheritOnly,AccessControlType.Allow))
Exit Sub
Case "ReadOnly"
dirsecurity.AddAccessRule(New FileSystemAccessRule(username,FileSystemRights.Read,AccessControlType.Allow))
Exit Sub
Case "Write"
dirsecurity.AddAccessRule(New FileSystemAccessRule(username,FileSystemRights.Write,AccessControlType.Allow))
Exit Sub
Case "Modify"
dirsecurity.AddAccessRule(New FileSystemAccessRule(username,FileSystemRights.Modify,AccessControlType.Allow))
Exit Sub
End Select
dirinfo.SetAccessControl(dirsecurity)
End Sub