#654: AccessChecker.java

projectforge-business/src/main/java/org/projectforge/framework/access/AccessChecker.java Lines: 275 · Author: Kai Reinhard · Type: Java interface — most reused interface 275 lines · 76 code · 149 comments · 50 blank

Central access control contract — 275 lines, 30+ methods. Described as "helper methods for evaluation of user and group access." Every page, every REST controller, every DAO calls this interface (via the static singleton) before performing protected operations. Implemented by AccessCheckerImpl (853 lines).

Method categories:

Design pattern — throwException parameter: Many methods have a boolean throwException variant. When true, denial throws AccessException; when false, returns boolean. This allows callers to check access without exception handling overhead when they just need a yes/no answer, and get an automatic exception with i18n message when failure must abort the operation.

Exception hierarchy in method prefixes: check* methods (e.g. checkIsLoggedInUserMemberOfAdminGroup()) are void and always throw on failure. has* methods return boolean and only throw if throwException=true.