Search in sources :

Example 66 with SessionImpl

use of org.apache.jackrabbit.core.SessionImpl in project pentaho-platform by pentaho.

the class MagicAceDefinitionTest method parseYamlFile.

private List<MagicAceDefinition> parseYamlFile(String filePath) throws Exception {
    SessionImpl mockSessionImpl = mock(SessionImpl.class);
    AccessControlManager mockAccessControlManager = mock(AccessControlManager.class);
    Privilege mockPrivilege = mock(Privilege.class);
    when(mockSessionImpl.getAccessControlManager()).thenReturn(mockAccessControlManager);
    when(mockAccessControlManager.privilegeFromName(any())).thenReturn(mockPrivilege);
    InputStream input = new FileInputStream(new File(filePath));
    return MagicAceDefinition.parseYamlMagicAceDefinitions(input, mockSessionImpl);
}
Also used : AccessControlManager(javax.jcr.security.AccessControlManager) FileInputStream(java.io.FileInputStream) InputStream(java.io.InputStream) SessionImpl(org.apache.jackrabbit.core.SessionImpl) Privilege(javax.jcr.security.Privilege) File(java.io.File) FileInputStream(java.io.FileInputStream)

Aggregations

SessionImpl (org.apache.jackrabbit.core.SessionImpl)66 RepositoryException (javax.jcr.RepositoryException)17 Node (javax.jcr.Node)12 Value (javax.jcr.Value)12 Name (org.apache.jackrabbit.spi.Name)12 NotExecutableException (org.apache.jackrabbit.test.NotExecutableException)11 Session (javax.jcr.Session)10 NodeImpl (org.apache.jackrabbit.core.NodeImpl)9 NodeId (org.apache.jackrabbit.core.id.NodeId)9 Principal (java.security.Principal)8 NodeIterator (javax.jcr.NodeIterator)7 Privilege (javax.jcr.security.Privilege)7 DataStoreGarbageCollector (org.apache.jackrabbit.api.management.DataStoreGarbageCollector)7 UserManager (org.apache.jackrabbit.api.security.user.UserManager)6 Path (org.apache.jackrabbit.spi.Path)6 JackrabbitAccessControlList (org.apache.jackrabbit.api.security.JackrabbitAccessControlList)5 PathMap (org.apache.jackrabbit.spi.commons.name.PathMap)5 ArrayList (java.util.ArrayList)4 Authorizable (org.apache.jackrabbit.api.security.user.Authorizable)4 GarbageCollector (org.apache.jackrabbit.core.gc.GarbageCollector)4