-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[apex] ApexCRUDViolation: user mode and system mode with test cases added #4244
Conversation
@rsoesemann and @rbklaassen please review this |
It looks pretty good @Tarush-Singh35. However, I can't tell from the code if it also covers the scenario where schema.isAccessible is used for the object/fieds. In that case it isn't needed to add a security mode to the SOQL query. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Please have a look at my comments.
...pex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/security/xml/ApexCRUDViolation.xml
Outdated
Show resolved
Hide resolved
pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexCRUDViolationRule.java
Show resolved
Hide resolved
...pex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/security/xml/ApexCRUDViolation.xml
Show resolved
Hide resolved
@rbklaassen sorry I did not understand what you are trying to say can you elaborate this |
pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexCRUDViolationRule.java
Outdated
Show resolved
Hide resolved
pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexCRUDViolationRule.java
Outdated
Show resolved
Hide resolved
@Tarush-Singh35 we have now a couple of test failures for some old tests. Can you look at them and decide, whether they are now wrong or whether the new rule changes do something wrong? https://github.com/pmd/pmd/actions/runs/3592105214/jobs/6047623060#step:7:7763
|
hey, @adangel I had gone through the code but could not find any error because I did not make any changes to the security enforced. Any help would be appreciated |
...pex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/security/xml/ApexCRUDViolation.xml
Outdated
Show resolved
Hide resolved
pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexCRUDViolationRule.java
Outdated
Show resolved
Hide resolved
...pex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/security/xml/ApexCRUDViolation.xml
Outdated
Show resolved
Hide resolved
Generated by 🚫 Danger |
Also support more DML methods: *async and *immediate
[apex] ApexCRUDViolation: user mode and system mode with test cases added #4244
Describe the PR
Extending the Rules to handle the ApexCrudViolation using User Mode and System Mode
Fixes