Search in sources :

Example 6 with SecurityAccessEntry

use of org.xwiki.security.authorization.SecurityAccessEntry in project xwiki-platform by xwiki.

the class DefaultSecurityCacheTest method mockSecurityAccessEntry.

private SecurityAccessEntry mockSecurityAccessEntry(final SecurityReference ref, final UserSecurityReference user) {
    SecurityAccessEntry entry = mock(SecurityAccessEntry.class, "Access for " + user.toString() + " on " + ref.toString());
    when(entry.getReference()).thenReturn(ref);
    when(entry.getUserReference()).thenReturn(user);
    return entry;
}
Also used : SecurityAccessEntry(org.xwiki.security.authorization.SecurityAccessEntry)

Aggregations

SecurityAccessEntry (org.xwiki.security.authorization.SecurityAccessEntry)6 GroupSecurityReference (org.xwiki.security.GroupSecurityReference)4 SecurityReference (org.xwiki.security.SecurityReference)4 UserSecurityReference (org.xwiki.security.UserSecurityReference)4 HashMap (java.util.HashMap)2 Test (org.junit.Test)2 SecurityEntry (org.xwiki.security.authorization.SecurityEntry)2 SecurityRuleEntry (org.xwiki.security.authorization.SecurityRuleEntry)2 ArrayList (java.util.ArrayList)1 LinkedList (java.util.LinkedList)1 Map (java.util.Map)1 DocumentReference (org.xwiki.model.reference.DocumentReference)1 AuthorizationException (org.xwiki.security.authorization.AuthorizationException)1 AuthorizationSettler (org.xwiki.security.authorization.AuthorizationSettler)1 ConflictingInsertionException (org.xwiki.security.authorization.cache.ConflictingInsertionException)1 ParentEntryEvictedException (org.xwiki.security.authorization.cache.ParentEntryEvictedException)1 SecurityShadowEntry (org.xwiki.security.authorization.cache.SecurityShadowEntry)1 UserBridge (org.xwiki.security.internal.UserBridge)1