本文整理汇总了Java中org.isisaddons.module.security.dom.user.ApplicationUser.setAtPath方法的典型用法代码示例。如果您正苦于以下问题:Java ApplicationUser.setAtPath方法的具体用法?Java ApplicationUser.setAtPath怎么用?Java ApplicationUser.setAtPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.isisaddons.module.security.dom.user.ApplicationUser
的用法示例。
在下文中一共展示了ApplicationUser.setAtPath方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerUser
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
@Override
public void registerUser(
final UserDetails userDetails) {
final Password password = new Password(userDetails.getPassword());
final ApplicationRole initialRole = getInitialRole();
final Boolean enabled = true;
final String username = userDetails.getUsername();
final String emailAddress = userDetails.getEmailAddress();
final ApplicationUser applicationUser = applicationUserRepository.newLocalUser(username, password, password, initialRole, enabled, emailAddress);
final Set<ApplicationRole> additionalRoles = getAdditionalInitialRoles();
if(additionalRoles != null) {
for (final ApplicationRole additionalRole : additionalRoles) {
applicationUser.addRole(additionalRole);
}
}
// set up new user custom
final ApplicationTenancy applicationTenancy = applicationTenancyRepository.newTenancy(username, "/" + username, null);
applicationUser.setAtPath(applicationTenancy.getPath());
fixtureScripts.runFixtureScript(new SematFixture(username, Arrays.asList(SudoService.ACCESS_ALL_ROLE)), null);
}
示例2: create
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
protected ApplicationUser create(
final String name,
final String emailAddress,
final AccountType accountType,
final String tenancyPath,
final ExecutionContext executionContext) {
final ApplicationUser applicationUser;
if(accountType == AccountType.DELEGATED) {
applicationUser = applicationUserRepository.newDelegateUser(name, null, null);
} else {
final String passwordStr = Util.coalesce(executionContext.getParameter("password"), getPassword(), "12345678a");
final Password password = new Password(passwordStr);
applicationUser = applicationUserRepository.newLocalUser(name, password, password, null, null, emailAddress);
}
applicationUser.setAtPath(tenancyPath);
executionContext.addResult(this, name, applicationUser);
return applicationUser;
}
示例3: happyCase
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
@Test
public void happyCase() {
// given
final ApplicationUser user = new ApplicationUser();
context.checking(new Expectations() {{
allowing(mockMeService).me();
will(returnValue(user));
}});
user.setAtPath("/ITA");
// when
propertyRepository.autoComplete("X?yz");
// then
assertThat(finderInteraction.getFinderMethod()).isEqualTo(FinderInteraction.FinderMethod.ALL_MATCHES);
assertThat(finderInteraction.getResultType()).isEqualTo(Property.class);
assertThat(finderInteraction.getQueryName()).isEqualTo("findByReferenceOrName");
final Map<String, Object> argsByParam = finderInteraction.getArgumentsByParameterName();
assertThat(argsByParam.get("referenceOrName")).isEqualTo((Object) "(?i).*X.yz.*");
assertThat(argsByParam).hasSize(1);
}
示例4: addUser
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
@Action(
domainEvent = AddUserDomainEvent.class,
semantics = SemanticsOf.IDEMPOTENT
)
@ActionLayout(
named="Add"
)
@MemberOrder(name="Users", sequence = "1")
public ApplicationTenancy addUser(final ApplicationUser applicationUser) {
applicationUser.setAtPath(this.getPath());
// no need to add to users set, since will be done by JDO/DN.
return this;
}
示例5: removeUser
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
@Action(
domainEvent = RemoveUserDomainEvent.class,
semantics = SemanticsOf.IDEMPOTENT
)
@ActionLayout(
named="Remove"
)
@MemberOrder(name="Users", sequence = "2")
public ApplicationTenancy removeUser(final ApplicationUser applicationUser) {
applicationUser.setAtPath(null);
// no need to add to users set, since will be done by JDO/DN.
return this;
}
示例6: addToUsers
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
public void addToUsers(final ApplicationUser applicationUser) {
applicationUser.setAtPath(getPath());
}
示例7: removeFromUsers
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
public void removeFromUsers(final ApplicationUser applicationUser) {
applicationUser.setAtPath(null);
}