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


Java PersonService.deletePerson方法代码示例

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


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

示例1: deleteUser

import org.alfresco.service.cmr.security.PersonService; //导入方法依赖的package包/类
/**
 * We assume: Admin user is already authenticated and userName already exists.
 * 
 * @param userName
 */
@SuppressWarnings("deprecation")
protected void deleteUser(String userName)
{
    PersonService personService = (PersonService) applicationContext.getBean("personService");
    personService.deletePerson(userName);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:12,代码来源:BaseAlfrescoSpringTest.java

示例2: setUp

import org.alfresco.service.cmr.security.PersonService; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
public void setUp() throws Exception
{
    AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getSystemUserName());
    
    if (AlfrescoTransactionSupport.getTransactionReadState() != TxnReadState.TXN_NONE)
    {
        throw new AlfrescoRuntimeException(
                "A previous tests did not clean up transaction: " +
                AlfrescoTransactionSupport.getTransactionId());
    }
    
    transactionService = (TransactionService) ctx.getBean("transactionService");
    personService = (PersonService) ctx.getBean("personService");
    userNameMatcher = (UserNameMatcherImpl) ctx.getBean("userNameMatcher");
    nodeService = (NodeService) ctx.getBean("nodeService");
    permissionService = (PermissionService) ctx.getBean("permissionService");
    authorityService = (AuthorityService) ctx.getBean("authorityService");
    authenticationDAO = (MutableAuthenticationDao) ctx.getBean("authenticationDao");
    policyBehaviourFilter = (BehaviourFilter) ctx.getBean("policyBehaviourFilter");

    testTX = transactionService.getUserTransaction();
    testTX.begin();

    //Set a max number of users.
    RepoUsageComponentImpl repoUsageComponent = (RepoUsageComponentImpl) ctx.getBean("repoUsageComponent");
    RepoUsage r = repoUsageComponent.getRestrictions();
    repoUsageComponent.setRestrictions(
            new RepoUsage(r.getLastUpdate(),
                    10000l,
                    r.getDocuments(),
                    r.getLicenseMode(),
                    r.getLicenseExpiryDate(),
                    r.isReadOnly()));
    
    StoreRef storeRef = nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.currentTimeMillis());
    rootNodeRef = nodeService.getRootNode(storeRef);
    
    for (NodeRef nodeRef : personService.getAllPeople())
    {
        String uid = DefaultTypeConverter.INSTANCE.convert(String.class, nodeService.getProperty(nodeRef, ContentModel.PROP_USERNAME));
        if (!uid.equals(AuthenticationUtil.getAdminUserName()) && !uid.equals(AuthenticationUtil.getGuestUserName()))
        {
            personService.deletePerson(nodeRef);
        }
    }
    
    personService.setCreateMissingPeople(true);
    
    testTX.commit();
    testTX = transactionService.getUserTransaction();
    testTX.begin();
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:54,代码来源:PersonTest.java


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