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


Java UserDetails类代码示例

本文整理汇总了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);
}
 
开发者ID:bibryam,项目名称:semat,代码行数:25,代码来源:AppUserRegistrationService.java

示例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;
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:4,代码来源:CreateUser.java


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