本文整理汇总了Java中org.apache.isis.applib.services.userreg.UserDetails类的典型用法代码示例。如果您正苦于以下问题:Java UserDetails类的具体用法?Java UserDetails怎么用?Java UserDetails使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UserDetails类属于org.apache.isis.applib.services.userreg包,在下文中一共展示了UserDetails类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerUser
import org.apache.isis.applib.services.userreg.UserDetails; //导入依赖的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: registerUser
import org.apache.isis.applib.services.userreg.UserDetails; //导入依赖的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);
}
}
}
开发者ID:isisaddons-legacy,项目名称:isis-module-security,代码行数:20,代码来源:SecurityModuleAppUserRegistrationServiceAbstract.java
示例3: getUserDetails
import org.apache.isis.applib.services.userreg.UserDetails; //导入依赖的package包/类
public UserDetails getUserDetails() {
return userDetails;
}