本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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);
}