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


Java IdentityService.isReadOnly方法代码示例

本文整理汇总了Java中org.camunda.bpm.engine.IdentityService.isReadOnly方法的典型用法代码示例。如果您正苦于以下问题:Java IdentityService.isReadOnly方法的具体用法?Java IdentityService.isReadOnly怎么用?Java IdentityService.isReadOnly使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.camunda.bpm.engine.IdentityService的用法示例。


在下文中一共展示了IdentityService.isReadOnly方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: availableOperations

import org.camunda.bpm.engine.IdentityService; //导入方法依赖的package包/类
public ResourceOptionsDto availableOperations(UriInfo context) {

    final IdentityService identityService = getIdentityService();

    UriBuilder baseUriBuilder = context.getBaseUriBuilder()
        .path(relativeRootResourcePath)
        .path(GroupRestService.PATH);

    ResourceOptionsDto resourceOptionsDto = new ResourceOptionsDto();

    // GET /
    URI baseUri = baseUriBuilder.build();
    resourceOptionsDto.addReflexiveLink(baseUri, HttpMethod.GET, "list");

    // GET /count
    URI countUri = baseUriBuilder.clone().path("/count").build();
    resourceOptionsDto.addReflexiveLink(countUri, HttpMethod.GET, "count");

    // POST /create
    if(!identityService.isReadOnly() && isAuthorized(CREATE)) {
      URI createUri = baseUriBuilder.clone().path("/create").build();
      resourceOptionsDto.addReflexiveLink(createUri, HttpMethod.POST, "create");
    }

    return resourceOptionsDto;
  }
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:27,代码来源:GroupRestServiceImpl.java

示例2: createUser

import org.camunda.bpm.engine.IdentityService; //导入方法依赖的package包/类
public void createUser(UserDto userDto) {
  final IdentityService identityService = getIdentityService();

  if(identityService.isReadOnly()) {
    throw new InvalidRequestException(Status.FORBIDDEN, "Identity service implementation is read-only.");
  }

  UserProfileDto profile = userDto.getProfile();
  if(profile == null || profile.getId() == null) {
    throw new InvalidRequestException(Status.BAD_REQUEST, "request object must provide profile information with valid id.");
  }

  User newUser = identityService.newUser(profile.getId());
  profile.update(newUser);

  if(userDto.getCredentials() != null) {
    newUser.setPassword(userDto.getCredentials().getPassword());
  }

  identityService.saveUser(newUser);

}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:23,代码来源:UserRestServiceImpl.java

示例3: availableOperations

import org.camunda.bpm.engine.IdentityService; //导入方法依赖的package包/类
public ResourceOptionsDto availableOperations(UriInfo context) {

    final IdentityService identityService = getIdentityService();

    UriBuilder baseUriBuilder = context.getBaseUriBuilder()
        .path(relativeRootResourcePath)
        .path(UserRestService.PATH);

    ResourceOptionsDto resourceOptionsDto = new ResourceOptionsDto();

    // GET /
    URI baseUri = baseUriBuilder.build();
    resourceOptionsDto.addReflexiveLink(baseUri, HttpMethod.GET, "list");

    // GET /count
    URI countUri = baseUriBuilder.clone().path("/count").build();
    resourceOptionsDto.addReflexiveLink(countUri, HttpMethod.GET, "count");

    // POST /create
    if(!identityService.isReadOnly() && isAuthorized(CREATE)) {
      URI createUri = baseUriBuilder.clone().path("/create").build();
      resourceOptionsDto.addReflexiveLink(createUri, HttpMethod.POST, "create");
    }

    return resourceOptionsDto;
  }
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:27,代码来源:UserRestServiceImpl.java

示例4: createGroup

import org.camunda.bpm.engine.IdentityService; //导入方法依赖的package包/类
public void createGroup(GroupDto groupDto) {
  final IdentityService identityService = getIdentityService();

  if(identityService.isReadOnly()) {
    throw new InvalidRequestException(Status.FORBIDDEN, "Identity service implementation is read-only.");
  }

  Group newGroup = identityService.newGroup(groupDto.getId());
  groupDto.update(newGroup);
  identityService.saveGroup(newGroup);

}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:13,代码来源:GroupRestServiceImpl.java


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