UFN_SECURITY_APPUSER_IN_NO_SITE_ROLE

Returns true if the given user is in a role that has rights to constituents with no site.

Return

Return Type
bit

Parameters

Parameter Parameter Type Mode Description
@APPUSERID uniqueidentifier IN

Definition

Copy


            create function dbo.UFN_SECURITY_APPUSER_IN_NO_SITE_ROLE
            (
                @APPUSERID uniqueidentifier
            )
            returns bit as

            /*
            Returns true if the given user is in a role whose site permission is constituents with 
            no sites.

            This function is optimized for use from the Blackbaud.AppFx.Security.Catalog.ConstitRecordSecurityService
            class which implements the RecordSecurity service for Constituent record security.
            As such, it assumes that a check for if the user is ISSYSADMIN occurs outside 
            this function.  
            */

            begin
                if exists
                    (
                        select 
                            1 
                        from 
                            dbo.SYSTEMROLEAPPUSER
                        where 
                            SYSTEMROLEAPPUSER.APPUSERID = @APPUSERID and 
                            SYSTEMROLEAPPUSER.SECURITYMODECODE = 1
                    )
                    return 1;

                return  0;
            end