diff --git a/util/Migrator/DbScripts/2021-07-15_00_OrganizationUserReadByMinimumRole.sql b/util/Migrator/DbScripts/2021-07-15_00_OrganizationUserReadByMinimumRole.sql index e5f22420f2..77779ec59a 100644 --- a/util/Migrator/DbScripts/2021-07-15_00_OrganizationUserReadByMinimumRole.sql +++ b/util/Migrator/DbScripts/2021-07-15_00_OrganizationUserReadByMinimumRole.sql @@ -17,6 +17,5 @@ BEGIN [dbo].[OrganizationUserUserDetailsView] WHERE OrganizationId = @OrganizationId - AND Status = 2 AND [Type] <= @MinRole END diff --git a/util/Migrator/DbScripts/2021-08-12_00_ReadByMinimumRoleCheckStatus.sql b/util/Migrator/DbScripts/2021-08-12_00_ReadByMinimumRoleCheckStatus.sql new file mode 100644 index 0000000000..cc2a70eff0 --- /dev/null +++ b/util/Migrator/DbScripts/2021-08-12_00_ReadByMinimumRoleCheckStatus.sql @@ -0,0 +1,22 @@ +IF OBJECT_ID('[dbo].[OrganizationUser_ReadByMinimumRole]') IS NOT NULL +BEGIN + DROP PROCEDURE [dbo].[OrganizationUser_ReadByMinimumRole] +END +GO + +CREATE PROCEDURE [dbo].[OrganizationUser_ReadByMinimumRole] + @OrganizationId UNIQUEIDENTIFIER, + @MinRole TINYINT +AS +BEGIN + SET NOCOUNT ON + + SELECT + * + FROM + [dbo].[OrganizationUserUserDetailsView] + WHERE + OrganizationId = @OrganizationId + AND Status = 2 + AND [Type] <= @MinRole +END