@Test public void hasAccessWithGuestUser() throws XWikiException { Assert.assertFalse(this.service.hasAccessLevel("view", "XWiki.XWikiGuest", "Some.Document", this.context)); }
@Override public boolean hasAccessLevel(String right, String username, String docname, XWikiContext context) throws XWikiException { User user = this.userManager.getUser(StringUtils.endsWith(username, "XWikiGuest") ? null : username, true); WikiReference wikiReference = new WikiReference(context.getWikiId()); DocumentReference document = resolveDocumentName(docname, wikiReference); return this.service.hasAccess(user, Right.toRight(right), document); }
ModularRightServiceImpl extends XWikiCachingRightService implements XWikiRightService { @Override public boolean hasAccessLevel(String right, String username, String docname, XWikiContext context) throws XWikiException { User user = this.userManager.getUser(StringUtils.endsWith(username, "XWikiGuest") ? null : username, true); WikiReference wikiReference = new WikiReference(context.getWikiId()); DocumentReference document = resolveDocumentName(docname, wikiReference); return this.service.hasAccess(user, Right.toRight(right), document); } }
ModularRightServiceImpl extends XWikiCachingRightService implements XWikiRightService { @Override public boolean hasAccessLevel(String right, String username, String docname, XWikiContext context) throws XWikiException { User user = this.userManager.getUser(StringUtils.endsWith(username, "XWikiGuest") ? null : username, true); WikiReference wikiReference = new WikiReference(context.getWikiId()); DocumentReference document = resolveDocumentName(docname, wikiReference); return this.service.hasAccess(user, Right.toRight(right), document); }  }
ModularRightServiceImpl extends XWikiCachingRightService implements XWikiRightService { @Override public boolean hasAccessLevel(String right, String username, String docname, XWikiContext context) throws XWikiException { User user = this.userManager.getUser(StringUtils.endsWith(username, "XWikiGuest") ? null : username, true); WikiReference wikiReference = new WikiReference(context.getWikiId()); DocumentReference document = resolveDocumentName(docname, wikiReference); return this.service.hasAccess(user, Right.toRight(right), document); }  @Override boolean checkAccess(String action, XWikiDocument doc, XWikiContext context); @Override boolean hasAccessLevel(String right, String username, String docname, XWikiContext context); }
ModularRightServiceImpl extends XWikiCachingRightService implements XWikiRightService { @Override public boolean hasAccessLevel(String right, String username, String docname, XWikiContext context) throws XWikiException { User user = this.userManager.getUser(StringUtils.endsWith(username, "XWikiGuest") ? null : username, true); WikiReference wikiReference = new WikiReference(context.getWikiId()); DocumentReference document = resolveDocumentName(docname, wikiReference); return this.service.hasAccess(user, Right.toRight(right), document); }  @Override boolean checkAccess(String action, XWikiDocument doc, XWikiContext context); @Override boolean hasAccessLevel(String right, String username, String docname, XWikiContext context);  }