UFN_REPORT_HASUSERSITEPERMISSION
Returns a row if a user has permission for a site in the context of a specific report.
Return
Return Type |
---|
table |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@CURRENTAPPUSERID | uniqueidentifier | IN | |
@FEATUREID | uniqueidentifier | IN | |
@SITEID | uniqueidentifier | IN |
Definition
Copy
create function dbo.UFN_REPORT_HASUSERSITEPERMISSION
(
@CURRENTAPPUSERID uniqueidentifier,
@FEATUREID uniqueidentifier,
@SITEID uniqueidentifier
)
returns table
as
return
(
select 1 as HASPERMISSION
where
dbo.UFN_APPUSER_ISSYSADMIN(@CURRENTAPPUSERID) = 1 or
exists
(
select 1
from dbo.UFN_SITESFORUSERONFEATURE(@CURRENTAPPUSERID,@FEATUREID, 21) -- 21 is the Feature Type value for report parameter
where
SITEID = @SITEID or
(
SITEID is null and
@SITEID is null
)
)
)