diff --git a/Design/Rule0015PermissionSetCoverage.cs b/Design/Rule0015PermissionSetCoverage.cs index 392116d4..c2cfb6ec 100644 --- a/Design/Rule0015PermissionSetCoverage.cs +++ b/Design/Rule0015PermissionSetCoverage.cs @@ -43,6 +43,11 @@ private void CheckPermissionSetCoverage(SymbolAnalysisContext context) PermissionObjectKind permObjectKind = PermissionObjectKind.Table; int permObjectId = appObjTypeSymbol.Id; + if (appObjTypeSymbol.IsObsoleteRemoved) + { + continue; + } + switch (appObjTypeSymbol.NavTypeKind) { case NavTypeKind.Codeunit: @@ -57,7 +62,7 @@ private void CheckPermissionSetCoverage(SymbolAnalysisContext context) case NavTypeKind.Report: permObjectKind = PermissionObjectKind.Report; break; - case NavTypeKind.Table: + case NavTypeKind.Record: permObjectKind = PermissionObjectKind.Table; break; case NavTypeKind.XmlPort: @@ -65,16 +70,17 @@ private void CheckPermissionSetCoverage(SymbolAnalysisContext context) break; } - if (appObjTypeSymbol.IsObsoleteRemoved) - { - continue; - } - if (permissionSymbols.Contains((permObjectKind, permObjectId)) || permissionSymbols.Contains((permObjectKind, 0)) || XmlPermissionExistsForObject(permissionSetDocuments, permObjectKind, permObjectId)) + if (!(permissionSymbols.Contains((permObjectKind, permObjectId)) || permissionSymbols.Contains((permObjectKind, 0)) || XmlPermissionExistsForObject(permissionSetDocuments, permObjectKind, permObjectId))) + context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.Rule0015PermissionSetCoverage, current.GetLocation(), new Object[] { permObjectKind.ToString(), appObjTypeSymbol.Name })); + + if (appObjTypeSymbol.NavTypeKind == NavTypeKind.Record) { - continue; + permObjectKind = PermissionObjectKind.TableData; + + if (!(permissionSymbols.Contains((permObjectKind, permObjectId)) || permissionSymbols.Contains((permObjectKind, 0)) || XmlPermissionExistsForObject(permissionSetDocuments, permObjectKind, permObjectId))) + context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.Rule0015PermissionSetCoverage, current.GetLocation(), new Object[] { permObjectKind.ToString(), appObjTypeSymbol.Name })); } - context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.Rule0015PermissionSetCoverage, current.GetLocation(), new Object[] { permObjectKind.ToString(), appObjTypeSymbol.Name })); } }