UFN_SITEALLOWEDFORUSER
Returns true if the user could access the SITE in some way.
Return
Return Type |
---|
bit |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@CURRENTAPPUSERID | uniqueidentifier | IN | |
@SITEID | uniqueidentifier | IN |
Definition
Copy
CREATE function dbo.UFN_SITEALLOWEDFORUSER
(
@CURRENTAPPUSERID uniqueidentifier,
@SITEID uniqueidentifier
)
returns bit
as
begin
if dbo.UFN_APPUSER_ISSYSADMIN(@CURRENTAPPUSERID) = 1 begin
return 1;
end;
if exists(
SELECT
SYSTEMROLEAPPUSER.ID
from
dbo.SYSTEMROLEAPPUSER
left join dbo.SITEPERMISSION on SITEPERMISSION.SYSTEMROLEAPPUSERID = SYSTEMROLEAPPUSER.ID
where
SYSTEMROLEAPPUSER.APPUSERID = @CURRENTAPPUSERID AND
(
(SITEPERMISSION.SITEID = @SITEID) or
(SYSTEMROLEAPPUSER.SECURITYMODECODE = 0) or
(SYSTEMROLEAPPUSER.SECURITYMODECODE = 1 and @SITEID is null)
)
) return 1;
return 0;
end