在aspx頁面中檢查使用者擁有訪問此頁許可權之後,即可檢查到使用者是否擁有相關的操作許可權,如「新增」,「編輯」,「更新」,「刪除」等操作許可權。
儲存過程:
setansi_nulls
ongo
setquoted_identifier
ongo
create
procedure
[dbo].
[usp_checkoperationaction](
@usersid
int,
@pagesid
int,
@operationvalue
int)
asdeclare
@usersrolecount
int,
@usersmodulecount
int,
@result
bit--
檢索使用者所擁有的角色
select
@usersrolecount=(
select
count(*
) from
[usersrole
]ur
inner
join
[rolepages
]rp
on(ur.
[roleid]=
rp.[
roleid])
where
ur.[
isenable]=
1and
rp.[
isenable]=
1and
ur.[
usersid]=
@usersid
andrp.
[pagesid]=
@pagesid)--
檢索使用者是否擁有操作許可權。
select
@usersmodulecount=(
select
count(*
) from
[usersmodule
]um
inner
join
[modulepages
]mp
on(um.
[moduleid]=
mp.[
moduleid])
where
(um.
[purview]&
@operationvalue
=@operationvalue
) and
mp.[
isenable]=
1and
um.[
usersid]=
@usersid
andmp.
[pagesid]=
@pagesid)if
((@usersrolecount
>0)
or(@usersmodulecount
>0))
--操作允許
set@result=1
else
--操作拒絕
set@result=0
return
@result
檢查使用者是否有操作許可權
在aspx頁面中檢查使用者擁有訪問此頁許可權之後,即可檢查到使用者是否擁有相關的操作許可權,如 新增 編輯 更新 刪除 等操作許可權。儲存過程 setansi nulls ongo setquoted identifier ongo create procedure dbo usp checkope...
badblocks檢查硬碟是否有壞道
硬碟是比較容易壞掉的裝置,使用一段時間後可能會出現壞道等物理故障。當硬碟出現壞道後,若不及時更換或者進行技術上的處理,磁碟的壞道就會越來越多,並會造成頻繁宕機和資料丟失。最好的處理方法是更換新的磁碟。在臨時的情況下,我們應及時遮蔽壞道部分的扇區,不要觸動它們。badblocks是乙個檢查磁碟是否有壞...
檢查當前使用者是否登陸
檢查當前使用者是否登陸 using system.security.principal this.page.user.identity.isauthenticated change password string oldpsw newpsw string username this.page.use...