当前位置: 首页>>代码示例>>Java>>正文


Java Session.getAcl方法代码示例

本文整理汇总了Java中org.apache.chemistry.opencmis.client.api.Session.getAcl方法的典型用法代码示例。如果您正苦于以下问题:Java Session.getAcl方法的具体用法?Java Session.getAcl怎么用?Java Session.getAcl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.chemistry.opencmis.client.api.Session的用法示例。


在下文中一共展示了Session.getAcl方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testRemoveAllPermissions_WEBSERVICE_10

import org.apache.chemistry.opencmis.client.api.Session; //导入方法依赖的package包/类
/**
 * cmisws?wsdl is not available using jetty in automated test suite should
 * be runned using an external alfresco server
 * 
 */
// @Test
public void testRemoveAllPermissions_WEBSERVICE_10()
{
    Folder testFolder = null;
    try
    {
        Session session = getWEBSERVICE_10_Session();
        if (session == null)
        {
            fail("WEBSERVICE 1.0 session cannot be null");
        }
        testFolder = createFolder(session, "testRemoveAllPermissions_WEBSERVICE_10");
        List<Ace> acl = create2TestACLs(session);

        // adding new ACE
        testFolder.addAcl(acl, AclPropagation.PROPAGATE);

        Acl allacl = session.getAcl(session.createObjectId(testFolder.getId()), false);
        int oldSize = allacl.getAces().size();

        // Removing ALL ACEs
        Acl newAcl = testFolder.removeAcl(allacl.getAces(), AclPropagation.PROPAGATE);

        int newsize = newAcl.getAces().size();

        System.out.println("Old ace size -->" + oldSize);
        System.out.println("New ace size --> " + newsize);

        assertTrue(newsize == oldSize - acl.size());
    }
    catch (Exception ex)
    {
        fail(ex.getMessage());
    }
    finally
    {
        if (testFolder != null)
        {
            testFolder.delete();
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:48,代码来源:TestRemovePermissions.java

示例2: testRemoveAllPermissions_ATOMPUB_10

import org.apache.chemistry.opencmis.client.api.Session; //导入方法依赖的package包/类
@Test
public void testRemoveAllPermissions_ATOMPUB_10()
{
    Folder testFolder = null;
    try
    {
        Session session = getATOMPUB_10_Session();
        if (session == null)
        {
            fail("ATOMPUB 1.0 session cannot be null");
        }
        testFolder = createFolder(session, "testRemoveAllPermissions_ATOMPUB_10");
        List<Ace> acl = create2TestACLs(session);

        // adding new ACE
        testFolder.addAcl(acl, AclPropagation.PROPAGATE);

        Acl allacl = session.getAcl(session.createObjectId(testFolder.getId()), false);
        int oldSize = allacl.getAces().size();

        // Removing ALL ACEs
        Acl newAcl = testFolder.removeAcl(allacl.getAces(), AclPropagation.PROPAGATE);

        int newsize = newAcl.getAces().size();

        System.out.println("Old ace size -->" + oldSize);
        System.out.println("New ace size --> " + newsize);

        assertTrue(newsize == oldSize - acl.size());
    }
    catch (Exception ex)
    {
        fail(ex.getMessage());
    }
    finally
    {
        if (testFolder != null)
        {
            testFolder.delete();
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:43,代码来源:TestRemovePermissions.java

示例3: testRemoveAllPermissions_ATOMPUB_11

import org.apache.chemistry.opencmis.client.api.Session; //导入方法依赖的package包/类
@Test
public void testRemoveAllPermissions_ATOMPUB_11()
{
    Folder testFolder = null;
    try
    {
        Session session = getATOMPUB_11_Session();
        if (session == null)
        {
            fail("ATOMPUB 1.1 session cannot be null");
        }
        testFolder = createFolder(session, "testRemoveAllPermissions_ATOMPUB_11");
        List<Ace> acl = create2TestACLs(session);

        // adding new ACE
        testFolder.addAcl(acl, AclPropagation.PROPAGATE);

        Acl allacl = session.getAcl(session.createObjectId(testFolder.getId()), false);
        int oldSize = allacl.getAces().size();

        // Removing ALL ACEs
        Acl newAcl = testFolder.removeAcl(allacl.getAces(), AclPropagation.PROPAGATE);

        int newsize = newAcl.getAces().size();

        System.out.println("Old ace size -->" + oldSize);
        System.out.println("New ace size --> " + newsize);

        assertTrue(newsize == oldSize - acl.size());
    }
    catch (Exception ex)
    {
        fail(ex.getMessage());
    }
    finally
    {
        if (testFolder != null)
        {
            testFolder.delete();
        }
    }

}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:44,代码来源:TestRemovePermissions.java

示例4: testRemoveAllPermissions_BROWSER_11

import org.apache.chemistry.opencmis.client.api.Session; //导入方法依赖的package包/类
@Test
public void testRemoveAllPermissions_BROWSER_11()
{
    Folder testFolder = null;
    try
    {
        Session session = getBROWSER_11_Session();
        if (session == null)
        {
            fail("ATOMPUB 1.1 session cannot be null");
        }
        testFolder = createFolder(session, "testRemoveAllPermissions_BROWSER_11");
        List<Ace> acl = create2TestACLs(session);

        // adding new ACE
        testFolder.addAcl(acl, AclPropagation.PROPAGATE);

        Acl allacl = session.getAcl(session.createObjectId(testFolder.getId()), false);
        int oldSize = allacl.getAces().size();

        // Removing ALL ACEs

        Acl newAcl = testFolder.removeAcl(allacl.getAces(), AclPropagation.PROPAGATE);
        int newsize = newAcl.getAces().size();

        System.out.println("Old ace size -->" + oldSize);
        System.out.println("New ace size --> " + newsize);

        assertTrue(newsize == oldSize - acl.size());
    }
    catch (Exception ex)
    {
        fail(ex.getMessage());
    }
    finally
    {
        if (testFolder != null)
        {
            testFolder.delete();
        }
    }

}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:44,代码来源:TestRemovePermissions.java


注:本文中的org.apache.chemistry.opencmis.client.api.Session.getAcl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。