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


Java ApplicationUser.setAtPath方法代码示例

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

示例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;
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-security,代码行数:22,代码来源:AbstractUserFixtureScript.java

示例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);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:25,代码来源:PropertyRepository_Test.java

示例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;
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-security,代码行数:14,代码来源:ApplicationTenancy.java

示例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;
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-security,代码行数:14,代码来源:ApplicationTenancy.java

示例6: addToUsers

import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
public void addToUsers(final ApplicationUser applicationUser) {
    applicationUser.setAtPath(getPath());
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-security,代码行数:4,代码来源:ApplicationTenancy.java

示例7: removeFromUsers

import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
public void removeFromUsers(final ApplicationUser applicationUser) {
    applicationUser.setAtPath(null);
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-security,代码行数:4,代码来源:ApplicationTenancy.java


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