UFN_SECURITY_APPUSER_GRANTED_BUSINESSPROCESS_IN_NONSITEROLE

Returns true if the given user has permissions to the given business process in a role that does not have site security defined.

Return

Return Type
bit

Parameters

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

Definition

Copy


        CREATE function dbo.UFN_SECURITY_APPUSER_GRANTED_BUSINESSPROCESS_IN_NONSITEROLE
        (
            @APPUSERID uniqueidentifier,
            @BUSINESSPROCESSCATALOGID uniqueidentifier
        )
        returns bit as

        /*
        Returns true if the given user has permissions to the given business process
        in a role whose site security is all 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 DENY occurs outside this function
        and also assumes that a check for if the user is ISSYSADMIN occurs outside 
        this function.  
        */

        begin
        if exists
            (
                select 
                    1 
                from 
                    dbo.V_SECURITY_SYSTEMROLEASSIGNMENT_USER_BUSINESSPROCESS as SV
                WHERE 
                    SV.APPUSERID = @APPUSERID AND 
                    SV.BUSINESSPROCESSCATALOGID = @BUSINESSPROCESSCATALOGID AND 
                    SV.GRANTORDENY = 1 AND 
                    SV.SITESECURITYMODE = 0
            )
         return 1;

        return  0;

        end