本文整理汇总了Java中org.isisaddons.module.security.dom.user.ApplicationUser.getAtPath方法的典型用法代码示例。如果您正苦于以下问题:Java ApplicationUser.getAtPath方法的具体用法?Java ApplicationUser.getAtPath怎么用?Java ApplicationUser.getAtPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.isisaddons.module.security.dom.user.ApplicationUser
的用法示例。
在下文中一共展示了ApplicationUser.getAtPath方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 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();
}
示例2: hides
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
@Override
public String hides(Object domainObject, ApplicationUser applicationUser) {
if (!(domainObject instanceof AbstractPersistable)) {
return null;
}
final AbstractPersistable persistable = (AbstractPersistable) domainObject;
final String atPath = applicationUser.getAtPath();
final ApplicationTenancy applicationUserTenancy = applicationTenancyRepository.findByPath(atPath);
final ApplicationTenancy persistableApplicationTenancy = persistable.getApplicationTenancy();
if (applicationUserTenancy == null || persistableApplicationTenancy == null) {
return "missing tenancy";
}
return applicationUserTenancy.equals(persistableApplicationTenancy) ? null: "different tenancies";
}
示例3: init
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
public void init() {
if (applicationTenancyPath == null) {
final String username = userService.getUser().getName();
final ApplicationUser applicationUser = applicationUserRepository.findByUsername(username);
String atPath = applicationUser.getAtPath();
final ApplicationTenancy applicationTenancy = applicationTenancyRepository.findByPathCached(atPath);
if(applicationTenancy == null) {
throw new IllegalStateException(String.format("No application tenancy defined for user '%s'", username));
}
applicationTenancyPath = applicationTenancy.getPath();
} else {
throw new IllegalStateException(String.format("Application tenancy defined for object '%s'", this));
}
}
示例4: doHides
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
private String doHides(final HasAtPath domainObject, final ApplicationUser applicationUser) {
HasAtPath hasAtPath = domainObject;
final String userAtPath = applicationUser.getAtPath();
final String objAtPath = hasAtPath.getAtPath();
if(objAtPath == null) {
return null;
}
if(userAtPath == null) {
return "hidden";
}
return !(userAtPath.startsWith(objAtPath) || objAtPath.startsWith(userAtPath)) ? "hidden" : null;
}
示例5: doDisables
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
private String doDisables(final HasAtPath domainObject, final ApplicationUser applicationUser) {
HasAtPath hasAtPath = domainObject;
final String userAtPath = applicationUser.getAtPath();
final String objAtPath = hasAtPath.getAtPath();
if(objAtPath == null) {
return null;
}
if(userAtPath == null) {
return String.format("Cannot edit the object with atPath of '%s'", hasAtPath);
}
return !objAtPath.startsWith(userAtPath) ? String.format("User with atPath of '%s' cannot edit the object with atPath of '%s'", userAtPath, objAtPath) : null;
}
示例6: 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();
}
示例7: userTenancyPathFor
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
private String userTenancyPathFor(final ApplicationUser applicationUser) {
// previously the code had this clause, but this is now always false because
// ApplicationUser (in sec module, as of 1.13.6) does not (cannot) implement
// org.estatio.dom.WithApplicationTenancy
// if(handles(applicationUser.getClass())) {
// return applicationTenancyPathFor(applicationUser);
// }
return applicationUser.getAtPath();
}
示例8: userProfileName
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
@Programmatic
@Override
public String userProfileName() {
final ApplicationUser currentUser = meService.me();
final String atPath = currentUser.getAtPath();
if(atPath != null) {
return String.format("%s @ %s", currentUser.getName(), atPath);
} else {
return String.format("%s", currentUser.getName());
}
}
示例9: upload
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
@Action(domainEvent = IncomingDocumentRepository.UploadDomainEvent.class)
@MemberOrder(sequence = "3")
public Document upload(final Blob blob) {
final String name = blob.getName();
final DocumentType type = DocumentTypeData.INCOMING.findUsing(documentTypeRepository);
final ApplicationUser me = meService.me();
String atPath = me != null ? me.getAtPath() : null;
if (atPath == null) {
atPath = "/";
}
return incomingDocumentRepository.upsertAndArchive(type, atPath, name, blob);
}
示例10: default0SwitchTenancy
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
public ApplicationTenancy default0SwitchTenancy() {
final ApplicationUser applicationUser = meService.me();
final String atPath = applicationUser.getAtPath();
return applicationTenancyRepository.findByPath(atPath);
}
示例11: userTenancyPathFor
import org.isisaddons.module.security.dom.user.ApplicationUser; //导入方法依赖的package包/类
protected String userTenancyPathFor(final ApplicationUser applicationUser) {
if (evaluator.handles(applicationUser.getClass())) {
return evaluator.applicationTenancyPathFor(applicationUser);
}
return applicationUser.getAtPath();
}
开发者ID:isisaddons-legacy,项目名称:isis-module-security,代码行数:7,代码来源:ApplicationTenancyEvaluatorUsingPaths.java