UFN_SECURITY_APPUSER_GRANTED_SECURITYATTRS_FORTASK

Returns a table of Constit Security Attribute IDs for which the user has been granted the task according to the role security groups.

Return

Return Type
table

Parameters

Parameter Parameter Type Mode Description
@APPUSERID uniqueidentifier IN
@TASKID uniqueidentifier IN

Definition

Copy


            CREATE function dbo.UFN_SECURITY_APPUSER_GRANTED_SECURITYATTRS_FORTASK
            (
                @APPUSERID uniqueidentifier,
                @TASKID uniqueidentifier
            )
            returns TABLE as

            /*
            Returns a row for every constituent security attribute that the the user has rights to according to record access security.
            */
            RETURN
            (

                select distinct
                    SYSTEMROLEAPPUSERCONSTITUENTSECURITY.CONSTITUENTSECURITYATTRIBUTEID
                from 
                    dbo.SYSTEMROLETASK
                    inner join dbo.SYSTEMROLEAPPUSER on SYSTEMROLETASK.SYSTEMROLEID = SYSTEMROLEAPPUSER.SYSTEMROLEID
                    inner join dbo.SYSTEMROLEAPPUSERCONSTITUENTSECURITY on SYSTEMROLEAPPUSERCONSTITUENTSECURITY.SYSTEMROLEAPPUSERID = SYSTEMROLEAPPUSER.ID
                where
                    SYSTEMROLEAPPUSER.APPUSERID = @APPUSERID and
                    SYSTEMROLETASK.TASKID = @TASKID and
                    SYSTEMROLEAPPUSER.CONSTITUENTSECURITYMODECODE = 2
            )