本文整理汇总了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);
}
示例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();
}