UFN_BBNC_APPUSER_ISVALIDSERVICEACCOUNT

Returns true if the appuser is in the special BBIS service account role.

Return

Return Type
bit

Parameters

Parameter Parameter Type Mode Description
@APPUSERID uniqueidentifier IN

Definition

Copy


            CREATE function dbo.UFN_BBNC_APPUSER_ISVALIDSERVICEACCOUNT(@APPUSERID uniqueidentifier) returns bit
            AS
            BEGIN

            /*
            Returns true if the appuser is in the special BBIS service account role.
            */

                declare @c int;
                declare @b bit;
                declare @HASBASICCMS bit = dbo.UFN_INSTALLEDPRODUCTS_PRODUCTIS('e5e0494b-ba0f-4e23-b8fb-a59112dbf3c8');
                declare @HASCMS bit = dbo.UFN_INSTALLEDPRODUCTS_PRODUCTIS('f238e8fe-06ae-4fdc-beaf-fdf6637e1982');

                select @c = count(*) from 
                dbo.SYSTEMROLE AS SR
                inner join dbo.SYSTEMROLEAPPUSER AS SRAU
                ON SR.ID=SRAU.SYSTEMROLEID

                where
                SRAU.APPUSERID=@APPUSERID
                and

                (SR.NAME='BBIS Web Service Authorized Accounts' or SR.NAME='BBNC Web Service Authorized Accounts') or 
                (SR.NAME = 'Web Forms Administrator' and @HASBASICCMS = 1 and @HASCMS = 0);


                if @c > 0
                    set @b = 1;                    
                else                    
                    set @b = 0;


                return @b;

                end