Skip to content

Commit

Permalink
LC0068 - false positive with IndirectPermissions StefanMaron#750
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanMaron committed Sep 3, 2024
1 parent d3f8e94 commit 4101303
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
codeunit 50000 MyCodeunit
{

[InherentPermissions(PermissionObjectType::TableData, Database::MyTable, 'rimd')]
[InherentPermissions(PermissionObjectType::TableData, Database::MyTable, 'RIMD')]
local procedure Test()
var
MyTable: Record MyTable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private bool ProcedureHasInherentPermission(IEnumerable<IAttributeSymbol> inhere
if (permissions[1].Trim() != "PermissionObjectType::TableData") continue;

var typeAndObjectName = permissions[2].Trim();
var permissionValue = permissions[3].Trim().Trim(new[] { '\'', ' ' });
var permissionValue = permissions[3].Trim().Trim(new[] { '\'', ' ' }).ToLowerInvariant();

var typeParts = typeAndObjectName.Split(new[] { "::" }, StringSplitOptions.RemoveEmptyEntries);
if (typeParts.Length < 2) continue;
Expand All @@ -183,7 +183,7 @@ private bool ProcedureHasInherentPermission(IEnumerable<IAttributeSymbol> inhere
#endif
continue;

if (permissionValue.Contains(requestedPermission))
if (permissionValue.Contains(requestedPermission.ToString().ToLowerInvariant()[0]))
{
return true;
}
Expand Down

0 comments on commit 4101303

Please sign in to comment.