/** * Load entity entries, group entries, and user entries required to settle the access, settle it, * add this decision into the cache and return the access. * * @param user The user to check access for. * @param entity The entity to check access to. * @return The resulting access for the user on the entity. * @throws ParentEntryEvictedException If one of the parent entries are evicted before the load is completed. * @throws ConflictingInsertionException When different threads have inserted conflicting entries into the cache. * @throws org.xwiki.security.authorization.AuthorizationException On error. */ private SecurityAccessEntry loadRequiredEntries(UserSecurityReference user, SecurityReference entity) throws ParentEntryEvictedException, ConflictingInsertionException, AuthorizationException { // No entity, return default rights for user in its wiki if (entity == null) { return authorizationSettlerProvider.get().settle(user, loadUserEntry(user, user.getWikiReference(), null), null); } // Retrieve rules for the entity from the cache Deque<SecurityRuleEntry> ruleEntries = getRules(entity); // Evaluate, store and return the access right return loadAccessEntries(user, entity, ruleEntries); }
SecurityAccessEntry accessEntry = authorizationSettlerProvider.get().settle(user, groups, ruleEntries);