Skip to content
Merged
2 changes: 1 addition & 1 deletion build/Packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Source": "NuGet.org"
},
"AppBaselines-BCArtifacts": {
"Version": "28.1.48062.0",
"Version": "28.1.48312.0",
"Source": "BCArtifacts",
"_comment": "Used to fetch app baselines from BC artifacts"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ codeunit 139940 "Qlty. Inspection Utility"
LibraryUtility: Codeunit "Library - Utility";
NoSeriesCodeunit: Codeunit "No. Series";
DefaultResult2PassCodeLbl: Label 'PASS', Locked = true;
SupervisorRoleIDTok: Label 'QltyMngmnt - Edit', Locked = true;
AdminSupervisorRoleIDTok: Label 'QltyMgmt - Admin', Locked = true;

internal procedure EnsureSetupExists()
var
QltyAutoConfigure: Codeunit "Qlty. Auto Configure";
UserPermissionsLibrary: Codeunit "User Permissions Library";
begin
QltyAutoConfigure.EnsureBasicSetupExists(false);
UserPermissionsLibrary.AssignPermissionSetToUser(UserSecurityId(), SupervisorRoleIDTok);
UserPermissionsLibrary.AssignPermissionSetToUser(UserSecurityId(), AdminSupervisorRoleIDTok);
end;

internal procedure CreateABasicTemplateAndInstanceOfAInspection(var OutCreatedQltyInspectionHeader: Record "Qlty. Inspection Header"; var OutQltyInspectionTemplateHdr: Record "Qlty. Inspection Template Hdr.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ codeunit 20406 "Qlty. Permission Mgmt."
ActionChangeItemTrackingLbl: Label 'change item tracking';
ActionChangeSourceQuantityLbl: Label 'change source quantity';
ActionEditLineCommentLbl: Label 'edit line note/comment';
SupervisorRoleIDTxt: Label 'QltyMngmnt - Edit', Locked = true;
AdminSupervisorRoleIDTxt: Label 'QltyMgmt - Admin', Locked = true;
UserDoesNotHavePermissionToErr: Label 'The user [%1] does not have permission to [%2].', Comment = '%1=User id, %2=permission being attempted';

/// <summary>
Expand Down Expand Up @@ -64,7 +64,7 @@ codeunit 20406 "Qlty. Permission Mgmt."
/// <returns>True if the user can change other users' inspections; otherwise, false.</returns>
internal procedure CanChangeOtherInspections(): Boolean
begin
exit(HasSupervisorRole());
exit(HasAdminSupervisorRole());
end;

/// <summary>
Expand All @@ -90,10 +90,22 @@ codeunit 20406 "Qlty. Permission Mgmt."
/// </summary>
internal procedure VerifyCanReopenInspection()
begin
if not CanModifyTableData(Database::"Qlty. Inspection Header") then
if not CanReopenInspection() then
Error(UserDoesNotHavePermissionToErr, UserId(), ActionReopenInspectionLbl);
end;

/// <summary>
/// Checks if the current user can reopen an inspection.
/// </summary>
/// <returns>True if the user can reopen an inspection; otherwise, false.</returns>
local procedure CanReopenInspection(): Boolean
begin
if not CanModifyTableData(Database::"Qlty. Inspection Header") then
exit(false);

exit(HasAdminSupervisorRole());
end;

/// <summary>
/// Verifies the current user can delete an open inspection. Throws an error if not permitted.
/// </summary>
Expand Down Expand Up @@ -121,7 +133,7 @@ codeunit 20406 "Qlty. Permission Mgmt."
if not CanDeleteTableData(Database::"Qlty. Inspection Header") then
exit(false);

exit(HasSupervisorRole());
exit(HasAdminSupervisorRole());
end;

/// <summary>
Expand Down Expand Up @@ -160,7 +172,7 @@ codeunit 20406 "Qlty. Permission Mgmt."
if not CanModifyTableData(Database::"Qlty. Inspection Header") then
exit(false);

exit(HasSupervisorRole());
exit(HasAdminSupervisorRole());
end;

/// <summary>
Expand Down Expand Up @@ -195,15 +207,15 @@ codeunit 20406 "Qlty. Permission Mgmt."
end;

#region Verify Permissions
local procedure HasSupervisorRole() IsAssigned: Boolean
local procedure HasAdminSupervisorRole() IsAssigned: Boolean
var
UserPermissions: Codeunit "User Permissions";
CurrentExtensionModuleInfo: ModuleInfo;
begin
IsAssigned := HasUserPermissionSetDirectlyAssigned(UserSecurityId(), SupervisorRoleIDTxt);
IsAssigned := HasUserPermissionSetDirectlyAssigned(UserSecurityId(), AdminSupervisorRoleIDTxt);
if not IsAssigned then
if NavApp.GetCurrentModuleInfo(CurrentExtensionModuleInfo) then
IsAssigned := UserPermissions.HasUserPermissionSetAssigned(UserSecurityId(), CompanyName(), SupervisorRoleIDTxt, 0, CurrentExtensionModuleInfo.Id());
IsAssigned := UserPermissions.HasUserPermissionSetAssigned(UserSecurityId(), CompanyName(), AdminSupervisorRoleIDTxt, 0, CurrentExtensionModuleInfo.Id());
if not IsAssigned then
IsAssigned := UserPermissions.IsSuper(UserSecurityId());
end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ page 20406 "Qlty. Inspection"
PromotedCategory = Report;
Caption = 'Non Conformance Report';
ToolTip = 'Specifies the Non Conformance Report has a layout suitable for quality inspection templates that typically contain Non Conformance Report questions.';
Image = PrintReport;
Image = Report;
Promoted = true;
PromotedIsBig = true;
PromotedOnly = true;
Expand All @@ -669,7 +669,7 @@ page 20406 "Qlty. Inspection"
PromotedCategory = Report;
Caption = 'Inspection Report';
ToolTip = 'General purpose inspection report.';
Image = PrintReport;
Image = Report;
Promoted = true;
PromotedIsBig = true;
PromotedOnly = true;
Expand Down Expand Up @@ -731,11 +731,13 @@ page 20406 "Qlty. Inspection"
QltyDocumentNavigation.NavigateToFindEntries(Rec);
end;
}
#pragma warning disable AS0031
#pragma warning disable AS0032
group(ItemAvailabilityBy)
{
Caption = 'Item Availability by';
Image = ItemAvailability;
action(tItemAvailabilityByEvent)
action(ItemAvailabilityByEvent)
{
ApplicationArea = Suite;
Caption = 'Event';
Expand All @@ -751,7 +753,7 @@ page 20406 "Qlty. Inspection"
AvailItemAvailabilityFormsMgt.ShowItemAvailabilityFromItem(Item, "Item Availability Type"::"Event");
end;
}
action(Period)
action(ItemAvailabilityByPeriod)
{
ApplicationArea = Suite;
Caption = 'Period';
Expand All @@ -762,7 +764,7 @@ page 20406 "Qlty. Inspection"
"Variant Filter" = field("Source Variant Code");
ToolTip = 'Show the projected quantity of the item over time according to time periods, such as day, week, or month.';
}
action(Variant)
action(ItemAvailabilityByVariant)
{
ApplicationArea = Planning;
Caption = 'Variant';
Expand All @@ -773,7 +775,7 @@ page 20406 "Qlty. Inspection"
"Variant Filter" = field("Source Variant Code");
ToolTip = 'View the current and projected quantity of the item for each variant.';
}
action(Location)
action(ItemAvailabilityByLocation)
{
ApplicationArea = Suite;
Caption = 'Location';
Expand All @@ -784,7 +786,7 @@ page 20406 "Qlty. Inspection"
"Variant Filter" = field("Source Variant Code");
ToolTip = 'View the actual and projected quantity of the item per location.';
}
action(Lot)
action(ItemAvailabilityByLot)
{
ApplicationArea = ItemTracking;
Caption = 'Lot';
Expand All @@ -793,7 +795,7 @@ page 20406 "Qlty. Inspection"
RunPageLink = "No." = field("Source Item No.");
ToolTip = 'View the current and projected quantity of the item for each lot.';
}
action(BinContents)
action(ItemAvailabilityByBinContents)
{
ApplicationArea = Warehouse;
Caption = 'Bin Contents';
Expand All @@ -804,7 +806,7 @@ page 20406 "Qlty. Inspection"
ToolTip = 'View the quantities of the item in each bin where it exists. You can see all the important parameters relating to bin content, and you can modify certain bin content parameters in this window.';
}
}
action(tShowTransfers)
action(ShowRelatedTransferDocuments)
{
Caption = 'Show Related Transfer Documents';
Image = TransferOrder;
Expand All @@ -816,6 +818,8 @@ page 20406 "Qlty. Inspection"
Rec.RunModalRelatedTransfers();
end;
}
#pragma warning restore AS0032
#pragma warning restore AS0031
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ table 20405 "Qlty. Inspection Header"
DrillDownPageId = "Qlty. Inspection List";
LookupPageId = "Qlty. Inspection List";
DataClassification = CustomerContent;
Permissions = tabledata "Qlty. Inspection Line" = d;
Permissions = tabledata "Qlty. Inspection Line" = d,
tabledata "Qlty. I. Result Condit. Conf." = d;

fields
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ table 20406 "Qlty. Inspection Line"
LookupPageId = "Qlty. Inspection Lines";
DrillDownPageId = "Qlty. Inspection Lines";
DataClassification = CustomerContent;
Permissions = tabledata "Qlty. I. Result Condit. Conf." = d;

fields
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ page 20408 "Qlty. Inspection List"
AccessByPermission = tabledata "Qlty. Inspection Header" = I;
Caption = 'Create Inspection';
ToolTip = 'Specifies to create a new Quality Inspection.';
Image = CreateForm;
Image = BulletList;
Promoted = true;
PromotedCategory = Process;
PromotedIsBig = true;
Expand Down Expand Up @@ -464,7 +464,7 @@ page 20408 "Qlty. Inspection List"
Caption = 'Non Conformance Report';
Enabled = RowActionsAreEnabled;
ToolTip = 'Specifies the Non Conformance Report has a layout suitable for quality inspection templates that typically contain Non Conformance Report questions.';
Image = PrintReport;
Image = Report;
Promoted = true;
PromotedIsBig = true;
PromotedOnly = true;
Expand All @@ -485,7 +485,7 @@ page 20408 "Qlty. Inspection List"
Caption = 'Inspection Report';
Enabled = RowActionsAreEnabled;
ToolTip = 'General purpose inspection report.';
Image = PrintReport;
Image = Report;
Promoted = true;
PromotedIsBig = true;
PromotedOnly = true;
Expand Down Expand Up @@ -550,12 +550,14 @@ page 20408 "Qlty. Inspection List"
QltyDocumentNavigation.NavigateToFindEntries(Rec);
end;
}
#pragma warning disable AS0031
#pragma warning disable AS0032
group(ItemAvailabilityBy)
{
Caption = 'Item Availability by';
Enabled = RowActionsAreEnabled;
Image = ItemAvailability;
action(tItemAvailabilityByEvent)
action(ItemAvailabilityByEvent)
{
ApplicationArea = Suite;
Caption = 'Event';
Expand All @@ -572,7 +574,7 @@ page 20408 "Qlty. Inspection List"
AvailItemAvailabilityFormsMgt.ShowItemAvailabilityFromItem(Item, "Item Availability Type"::"Event");
end;
}
action(Period)
action(ItemAvailabilityByPeriod)
{
ApplicationArea = Suite;
Caption = 'Period';
Expand All @@ -584,7 +586,7 @@ page 20408 "Qlty. Inspection List"
"Variant Filter" = field("Source Variant Code");
ToolTip = 'Show the projected quantity of the item over time according to time periods, such as day, week, or month.';
}
action(Variant)
action(ItemAvailabilityByVariant)
{
ApplicationArea = Planning;
Caption = 'Variant';
Expand All @@ -596,7 +598,7 @@ page 20408 "Qlty. Inspection List"
"Variant Filter" = field("Source Variant Code");
ToolTip = 'View the current and projected quantity of the item for each variant.';
}
action(Location)
action(ItemAvailabilityByLocation)
{
ApplicationArea = Suite;
Caption = 'Location';
Expand All @@ -608,7 +610,7 @@ page 20408 "Qlty. Inspection List"
"Variant Filter" = field("Source Variant Code");
ToolTip = 'View the actual and projected quantity of the item per location.';
}
action(Lot)
action(ItemAvailabilityByLot)
{
ApplicationArea = ItemTracking;
Caption = 'Lot';
Expand All @@ -618,7 +620,7 @@ page 20408 "Qlty. Inspection List"
RunPageLink = "No." = field("Source Item No.");
ToolTip = 'View the current and projected quantity of the item for each lot.';
}
action(BinContents)
action(ItemAvailabilityByBinContents)
{
ApplicationArea = Warehouse;
Caption = 'Bin Contents';
Expand All @@ -630,6 +632,8 @@ page 20408 "Qlty. Inspection List"
ToolTip = 'View the quantities of the item in each bin where it exists. You can see all the important parameters relating to bin content, and you can modify certain bin content parameters in this window.';
}
}
#pragma warning restore AS0032
#pragma warning restore AS0031
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ namespace Microsoft.QualityManagement.Permissions;

using System.Security.AccessControl;

permissionsetextension 20400 "D365 BASIC - QltyMngmnt" extends "D365 BASIC"
#pragma warning disable AS0090
permissionsetextension 20402 "Administrator - QltyMgmt" extends "Administrator"
{
IncludedPermissionSets = "QltyMngmnt - Edit";
}
IncludedPermissionSets = "QltyMgmt - Admin";
}
#pragma warning restore AS0090
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ namespace Microsoft.QualityManagement.Permissions;

using System.Security.AccessControl;

permissionsetextension 20401 "D365 BUS FULL ACCESS - QltyMngmnt" extends "D365 BUS FULL ACCESS"
#pragma warning disable AS0090
permissionsetextension 20400 "D365 BASIC ISV - QltyMgmt" extends "D365 BASIC ISV"
{
IncludedPermissionSets = "QltyMngmnt - Edit";
}
IncludedPermissionSets = "QltyMgmt - Admin";
}
#pragma warning restore AS0090
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ namespace Microsoft.QualityManagement.Permissions;

using System.Security.AccessControl;

permissionsetextension 20403 "D365 READ - QltyMngmnt" extends "D365 READ"
#pragma warning disable AS0090
permissionsetextension 20401 "D365 BUS FULL ACCESS - QltyMgmt" extends "D365 BUS FULL ACCESS"
{
IncludedPermissionSets = "QltyMngmnt - Read";
}
IncludedPermissionSets = "QltyMgmt - Admin";
}
#pragma warning restore AS0090
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ namespace Microsoft.QualityManagement.Permissions;

using System.Security.AccessControl;

permissionsetextension 20402 "Administrator - QltyMngmnt" extends "Administrator"
#pragma warning disable AS0090
permissionsetextension 20403 "D365 READ - QltyMgmt" extends "D365 READ"
{
IncludedPermissionSets = "QltyMngmnt - Edit";
}
IncludedPermissionSets = "QltyMgmt - Read";
}
#pragma warning restore AS0090
Loading
Loading