UFN_SECURITY_APPUSER_GRANTED_CONSTITIDS_FORFEATURE

Returns a table of ConstituentIDs for which the user has been granted the feature according to the role security groups.

Return

Return Type
table

Parameters

Parameter Parameter Type Mode Description
@APPUSERID uniqueidentifier IN
@FEATUREID uniqueidentifier IN
@FEATURETYPE tinyint IN

Definition

Copy


            create function dbo.UFN_SECURITY_APPUSER_GRANTED_CONSTITIDS_FORFEATURE
            (
                @APPUSERID uniqueidentifier,
                @FEATUREID uniqueidentifier,
                @FEATURETYPE tinyint 
            )
            returns @CONSTITUENTS table(ID uniqueidentifier) as

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

            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.  

            It also assumes a check for UFN_SECURITY_APPUSER_GRANTED_FEATURE_IN_NONRACROLE 
            occurs outside this function. If that function returns true there is no need to join to this TVF.

            */
             begin
                if @FEATURETYPE = 1 -- SecurityFeatureType.Form  

                begin
                    insert into @CONSTITUENTS 
                        select ID from dbo.UFN_SECURITY_APPUSER_GRANTED_CONSTITIDS_FORFORM(@APPUSERID,@FEATUREID)
                end

                if @FEATURETYPE = 2 -- SecurityFeatureType.DataList 

                begin
                    insert into @CONSTITUENTS 
                        select ID from dbo.UFN_SECURITY_APPUSER_GRANTED_CONSTITIDS_FORDATALIST(@APPUSERID,@FEATUREID)
                end

                if @FEATURETYPE = 4 -- SecurityFeatureType.BusinessProcess

                begin
                    insert into @CONSTITUENTS 
                        select ID from dbo.UFN_SECURITY_APPUSER_GRANTED_CONSTITIDS_FORBUSINESSPROCESS(@APPUSERID,@FEATUREID)
                end

                if @FEATURETYPE = 5 -- SecurityFeatureType.Dashboard  

                begin
                    insert into @CONSTITUENTS 
                        select ID from dbo.UFN_SECURITY_APPUSER_GRANTED_CONSTITIDS_FORDASHBOARD(@APPUSERID,@FEATUREID)
                end

                if @FEATURETYPE = 8  -- SecurityFeatureType.Task

                begin
                    insert into @CONSTITUENTS 
                        select ID from dbo.UFN_SECURITY_APPUSER_GRANTED_CONSTITIDS_FORTASK(@APPUSERID,@FEATUREID)
                end

                if @FEATURETYPE = 9 -- SecurityFeatureType.SmartQuery  

                begin
                    insert into @CONSTITUENTS 
                        select ID from dbo.UFN_SECURITY_APPUSER_GRANTED_CONSTITIDS_FORSMARTQUERY(@APPUSERID,@FEATUREID)
                end

                if @FEATURETYPE = 10  -- SecurityFeatureType.AdHocQueryView  

                begin
                    insert into @CONSTITUENTS 
                        select ID from dbo.UFN_SECURITY_APPUSER_GRANTED_CONSTITIDS_FORQUERYVIEW(@APPUSERID,@FEATUREID)
                end

                if @FEATURETYPE = 15  -- SecurityFeatureType.Batch  

                begin
                    insert into @CONSTITUENTS 
                        select ID from dbo.UFN_SECURITY_APPUSER_GRANTED_CONSTITIDS_FORBATCH(@APPUSERID,@FEATUREID)
                end

                -- if @FEATURETYPE = 11  -- SecurityFeatureType.BatchType  

                -- if @FEATURETYPE = 12  -- SecurityFeatureType.AddCodeTableEntry             

                -- if @FEATURETYPE = 13  -- SecurityFeatureType.UpdateCodeTableEntry

                -- if @FEATURETYPE = 14  -- SecurityFeatureType.DeleteCodeTableEntry

                -- if @FEATURETYPE = 16  -- SecurityFeatureType.BatchTemplate                  

                -- if @FEATURETYPE = 17  -- SecurityFeatureType.Kpi              

                -- if @FEATURETYPE = 18  -- SecurityFeatureType.MergeTask    

                -- if @FEATURETYPE = 19  -- SecurityFeatureType.SmartField      

                -- if @FEATURETYPE = 20  -- SecurityFeatureType.GlobalChange  

                -- if @FEATURETYPE = 21  -- SecurityFeatureType.ReportParameter

                -- if @FEATURETYPE = 22  -- SecurityFeatureType.SystemPrivilege      

                -- if @FEATURETYPE = 23  -- SecurityFeatureType.ConfigurationData  

                -- if @FEATURETYPE = 24  -- SecurityFeatureType.BatchTemplateCustomize  

                -- if @FEATURETYPE = 25  -- SecurityFeatureType.BatchProcessor  

                -- if @FEATURETYPE = 26  -- SecurityFeatureType.Page  


                return;
            end