本文整理汇总了Java中org.isisaddons.module.security.dom.user.ApplicationUser.getName方法的典型用法代码示例。如果您正苦于以下问题:Java ApplicationUser.getName方法的具体用法?Java ApplicationUser.getName怎么用?Java ApplicationUser.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.isisaddons.module.security.dom.user.ApplicationUser
的用法示例。
在下文中一共展示了ApplicationUser.getName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: userProfileName
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
@Override
@Programmatic
public String userProfileName() {
final ApplicationUser applicationUser = meService.me();
final StringBuilder buf = new StringBuilder();
final String username = applicationUser.getName();
final ApplicationTenancy tenancy = applicationUser.getTenancy();
buf.append("Hi ");
buf.append(username);
if (tenancy.getName() != null) {
buf.append(" @").append(tenancy.getName());
}
return buf.toString();
}
示例2: userProfileName
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
@Override
@Programmatic
public String userProfileName() {
final ApplicationUser applicationUser = meService.me();
final StringBuilder buf = new StringBuilder();
final String username = applicationUser.getName();
final String atPath = applicationUser.getAtPath();
final ApplicationTenancy tenancy = applicationTenancyRepository.findByPath(atPath);
buf.append("Hi ");
buf.append(username);
if (tenancy.getName() != null) {
buf.append(" @").append(tenancy.getName());
}
return buf.toString();
}
示例3: userProfileName
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
@Override
@Programmatic
public String userProfileName() {
final ApplicationUser applicationUser = meService.me();
final StringBuilder buf = new StringBuilder();
final String username = applicationUser.getName();
final ApplicationTenancy tenancy = applicationUser.getTenancy();
buf.append("Hi ");
buf.append(username);
if (!tenancy.getPath().equals(UsersTenancy.TENANCY_PATH + username)) {
buf.append(" @").append(tenancy.getName());
}
return buf.toString();
}
示例4: userProfileName
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
@Override
@Programmatic
public String userProfileName() {
final ApplicationUser applicationUser = meService.me();
final StringBuilder buf = new StringBuilder();
final String username = applicationUser.getName();
final String tenancyPath = applicationUser.getAtPath();
buf.append("Hi ");
buf.append(username);
buf.append(" @").append(tenancyPath);
return buf.toString();
}
示例5: createTenancyIfRequired
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
protected void createTenancyIfRequired(final ApplicationUser newUser) {
final String username = newUser.getName();
final String atPath = UsersTenancy.TENANCY_PATH + username; // eg "/users/fred"
ApplicationTenancy applicationTenancy = applicationTenancyRepository.findByName(atPath);
if(applicationTenancy == null) {
final ApplicationTenancy globalTenancy = applicationTenancyRepository.findByPath( UsersTenancy.TENANCY_PATH);
applicationTenancy = applicationTenancyRepository.newTenancy(username, atPath, globalTenancy);
}
newUser.setTenancy(applicationTenancy);
}
示例6: deleteTenancyIfRequired
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
protected void deleteTenancyIfRequired(final ApplicationUser newUser) {
final String username = newUser.getName();
final String atPath = UsersTenancy.TENANCY_PATH + username;
final ApplicationTenancy applicationTenancy = applicationTenancyRepository.findByPath(atPath);
if(applicationTenancy != null) {
applicationTenancy.delete(true);
}
}
示例7: from
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
public static PrincipalForApplicationUser from(ApplicationUser applicationUser) {
if(applicationUser == null) {
return null;
}
final String username = applicationUser.getName();
final String encryptedPassword = applicationUser.getEncryptedPassword();
final AccountType accountType = applicationUser.getAccountType();
final Set<String> roles = Sets.newTreeSet(Lists.newArrayList(Iterables.transform(applicationUser.getRoles(), ApplicationRole.Functions.GET_NAME)));
final ApplicationPermissionValueSet permissionSet = applicationUser.getPermissionSet();
return new PrincipalForApplicationUser(username, encryptedPassword, accountType, applicationUser.getStatus(), roles, permissionSet);
}