DocumentrPermissionEvaluator implements PermissionEvaluator { public boolean hasApplicationPermission(Authentication authentication, Permission permission) { return hasApplicationPermission(authentication.getAuthorities(), permission); }  @Override boolean hasPermission(Authentication authentication, Object targetDomainObject, Object permission); @Override boolean hasPermission(Authentication authentication, Serializable targetId, String targetType,
			Object permission); boolean hasApplicationPermission(Authentication authentication, Permission permission); boolean hasProjectPermission(Authentication authentication, String projectName, Permission permission); boolean hasAnyProjectPermission(Authentication authentication, Permission permission); boolean hasBranchPermission(Authentication authentication, String projectName, String branchName,
			Permission permission); boolean hasAnyBranchPermission(Authentication authentication, String projectName, Permission permission); boolean hasPagePermission(Authentication authentication, String projectName, String branchName,
			String path, Permission permission); boolean hasPagePermissionInOtherBranches(Authentication authentication, String projectName,
			String branchName, String path, Permission permission); Set<String> getBranchesForPermission(Authentication authentication, Permission permission); boolean isAdmin(String loginName); boolean isLastAdminRole(String roleName);  }
@Test public void hasApplicationPermission() { Authentication authentication = mockAuthentication(new PermissionGrantedAuthority( GrantedAuthorityTarget.APPLICATION, Permission.EDIT_PAGE)); assertTrue(permissionEvaluator.hasApplicationPermission( authentication, Permission.EDIT_PAGE)); }
@Test public void hasApplicationPermissionMustHonorAdminPermission() { Authentication authentication = mockAuthentication(new PermissionGrantedAuthority( GrantedAuthorityTarget.APPLICATION, Permission.ADMIN)); assertTrue(permissionEvaluator.hasApplicationPermission( authentication, Permission.EDIT_PAGE)); }