File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
csharp/ql/lib/semmle/code/csharp/frameworks/microsoft Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,14 @@ class MicrosoftAspNetCoreMvcNonActionAttribute extends MicrosoftAspNetCoreMvcAtt
62
62
MicrosoftAspNetCoreMvcNonActionAttribute ( ) { this .getType ( ) .hasName ( "NonActionAttribute" ) }
63
63
}
64
64
65
+ class MicrosoftAspNetCoreMvcNonControllerAttribute extends MicrosoftAspNetCoreMvcAttribute {
66
+ MicrosoftAspNetCoreMvcNonControllerAttribute ( ) { getType ( ) .hasName ( "NonControllerAttribute" ) }
67
+ }
68
+
69
+ class MicrosoftAspNetCoreMvcControllerAttribute extends MicrosoftAspNetCoreMvcAttribute {
70
+ MicrosoftAspNetCoreMvcControllerAttribute ( ) { getType ( ) .hasName ( "ControllerAttribute" ) }
71
+ }
72
+
65
73
/** The `Microsoft.AspNetCore.Antiforgery` namespace. */
66
74
class MicrosoftAspNetCoreAntiforgeryNamespace extends Namespace {
67
75
MicrosoftAspNetCoreAntiforgeryNamespace ( ) {
@@ -185,7 +193,12 @@ class MicrosoftAspNetCoreMvcControllerBaseClass extends Class {
185
193
/** A subtype of `Microsoft.AspNetCore.Mvc.Controller` or `Microsoft.AspNetCore.Mvc.ControllerBase`. */
186
194
class MicrosoftAspNetCoreMvcController extends Class {
187
195
MicrosoftAspNetCoreMvcController ( ) {
188
- this .getABaseType * ( ) instanceof MicrosoftAspNetCoreMvcControllerBaseClass
196
+ (
197
+ getABaseType * ( ) instanceof MicrosoftAspNetCoreMvcControllerBaseClass or
198
+ getABaseType * ( ) .hasName ( "%Controller" ) or
199
+ getABaseType * ( ) .getAnAttribute ( ) instanceof MicrosoftAspNetCoreMvcControllerAttribute
200
+ ) and
201
+ not getABaseType * ( ) .getAnAttribute ( ) instanceof MicrosoftAspNetCoreMvcNonControllerAttribute
189
202
}
190
203
191
204
/** Gets an action method for this controller. */
You can’t perform that action at this time.
0 commit comments