USP_SECURITY_SYSTEMROLEFEATUREFOLDER_GET_KPIS

Gets state of feature permissions for KPIs for the given System Role ID.

Parameters

Parameter Parameter Type Mode Description
@SYSTEMROLEID uniqueidentifier IN
@ONLYASSIGNED bit IN

Definition

Copy


                CREATE procedure [dbo].[USP_SECURITY_SYSTEMROLEFEATUREFOLDER_GET_KPIS]
                (
                    @SYSTEMROLEID uniqueidentifier,
                    @ONLYASSIGNED bit = 0
                )
                /* Used by the SecurityGetRoleFeaturePermTreeRequest web service */
                as
                set nocount on;

                if @SYSTEMROLEID is null
                begin
                    raiserror('@SYSTEMROLEID is required',16,10);
                    return 7;
                end;

                select
                    [CATALOG].ID,
                    [CATALOG].NAME,
                    [CATALOG].SECURITYUIFOLDER,
                    [PERM].GRANTORDENY,
                    [CATALOG].DESCRIPTION,
                    [PERM].ID as [PERMISSIONID],
                    [CATALOG].SPECXML
                from 
                    dbo.KPICATALOG as [CATALOG]
                left outer join
                    (
                        select 
                            ID, 
                            GRANTORDENY, 
                            KPICATALOGID 
                        from 
                            dbo.SYSTEMROLEPERM_KPI
                        where 
                            SYSTEMROLEID = @SYSTEMROLEID
                    ) as [PERM] on [PERM].KPICATALOGID = [CATALOG].ID
                where 
                    ([PERM].ID is not null) or (@ONLYASSIGNED = 0)
                order by 
                    [CATALOG].SECURITYUIFOLDER, [CATALOG].NAME;