UFN_SECURITY_APPUSER_GRANTED_SECURITYATTRS_FORQUERYVIEW

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

Return

Return Type
table

Parameters

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

Definition

Copy


            CREATE function dbo.UFN_SECURITY_APPUSER_GRANTED_SECURITYATTRS_FORQUERYVIEW
            (
            @APPUSERID uniqueidentifier,
            @QUERYVIEWCATALOGID 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.SYSTEMROLEPERM_QUERYVIEW 
                    inner join dbo.SYSTEMROLEAPPUSER on SYSTEMROLEPERM_QUERYVIEW.SYSTEMROLEID = SYSTEMROLEAPPUSER.SYSTEMROLEID
                    inner join dbo.SYSTEMROLEAPPUSERCONSTITUENTSECURITY on SYSTEMROLEAPPUSERCONSTITUENTSECURITY.SYSTEMROLEAPPUSERID = SYSTEMROLEAPPUSER.ID
                where
                    SYSTEMROLEAPPUSER.APPUSERID = @APPUSERID and
                    SYSTEMROLEAPPUSER.CONSTITUENTSECURITYMODECODE = 2 and
                    SYSTEMROLEPERM_QUERYVIEW.QUERYVIEWCATALOGID = @QUERYVIEWCATALOGID
            )