Skip to content
Commit ba2336ca authored by mattgilbride's avatar mattgilbride Committed by Matt Gilbride
Browse files

SimpleManualPermissionEnforcementDetector: Handle anyOf

Handle "anyOf" style checks. @PermissionMethod now takes a parameter
indicating that, if multiple permissions are checked, any ONE of them
being granted means the permission check passes. This equates to the
same "anyOf" parameter on the @EnforcePermission annotation, so generate
fixes accordingly.

The "anyOf" logic also includes some sanity checking to prevent
suggesting a fix if "anyOf" and "allOf" checks are mixed, as we don't
know what to do if that is the case.

This change also enhances the linter's ability to pull out
permission values (annotated with @PermissionName).
 - it reads hard coded values provided as parameters to the
   @PermissionMethod annotation
 - it reads multiple @PermissionName values passed as varargs to a
   method

Bug: 232058525
Test: SimpleManualPermissionEnforcementDetectorTest
Change-Id: I4e6a54a2820d54726725ea1e4a4b208e337e34c5
parent 2c533174
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment