UFN_CONSTITUENTSECURITYATTRIBUTE_REQUIREDFORUSER
Returns true if the user is only a member of roles that specify a security group.
Return
| Return Type |
|---|
| bit |
Parameters
| Parameter | Parameter Type | Mode | Description |
|---|---|---|---|
| @CURRENTAPPUSERID | uniqueidentifier | IN |
Definition
Copy
CREATE function dbo.UFN_CONSTITUENTSECURITYATTRIBUTE_REQUIREDFORUSER
(
@CURRENTAPPUSERID uniqueidentifier
)
returns bit
as
begin
/*The application user is a system administrator*/
if dbo.UFN_APPUSER_ISSYSADMIN(@CURRENTAPPUSERID)= 1 begin
return 0;
end;
/*Role is set to allow access to all records or records with no security group*/
if exists(SELECT SYSTEMROLEAPPUSER.ID from dbo.SYSTEMROLEAPPUSER where SYSTEMROLEAPPUSER.APPUSERID = @CURRENTAPPUSERID AND (SYSTEMROLEAPPUSER.CONSTITUENTSECURITYMODECODE = 0 or SYSTEMROLEAPPUSER.CONSTITUENTSECURITYMODECODE = 1)) begin
return 0;
end;
return 1;
end