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


Java ApplicationUser.getAtPath方法代码示例

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

示例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";
}
 
开发者ID:bibryam,项目名称:semat,代码行数:18,代码来源:SematApplicationTenancyEvaluator.java

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

示例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;
}
 
开发者ID:incodehq,项目名称:ecpcrm,代码行数:15,代码来源:ApplicationTenancyEvaluatorForEcpCrm.java

示例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;
}
 
开发者ID:incodehq,项目名称:ecpcrm,代码行数:15,代码来源:ApplicationTenancyEvaluatorForEcpCrm.java

示例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();
}
 
开发者ID:incodehq,项目名称:ecpcrm,代码行数:16,代码来源:UserProfileServiceShowingTenancy.java

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

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

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

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

示例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


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