UFN_SECURITY_APPUSER_GRANTED_MAPENTITY_IN_SYSTEMROLE

Returns true if the user has been granted and not denied the map entity for a System Role.

Return

Return Type
bit

Parameters

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

Definition

Copy


            CREATE function dbo.UFN_SECURITY_APPUSER_GRANTED_MAPENTITY_IN_SYSTEMROLE (
                @APPUSERID uniqueidentifier,
                @MAPENTITYID uniqueidentifier
            )
            returns bit 
            as
            /*
            Returns true if user has been granted and not denied the map entity for a System Role.
            */
            begin
                --If at least one grant and no deny then return true

                --otherwise, false

                declare @grant bit;
                set @grant=0;

                --order by GRANTORDENY, deny will be first.


                select top 1 @grant=GRANTORDENY

                from dbo.V_SECURITY_SYSTEMROLEASSIGNMENT_USER_MAPENTITY

                where APPUSERID = @APPUSERID
                and MAPENTITYCATALOGID=@MAPENTITYID

                order by GRANTORDENY ASC;


                return @grant;

            end