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


Java Filter.setOwner方法代码示例

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


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

示例1: FAILING_testUpdateFilterGenericOwnerId

import org.camunda.bpm.engine.filter.Filter; //导入方法依赖的package包/类
/**
 * CAM-4889
 */
public void FAILING_testUpdateFilterGenericOwnerId() {
  grantCreateFilter();

  Filter filter = filterService.newTaskFilter("someName");
  filterService.saveFilter(filter);

  grantUpdateFilter(filter.getId());
  filter.setOwner("*");

  try {
    filterService.saveFilter(filter);
    fail("it should not be possible to save a filter with the generic owner id");
  } catch (ProcessEngineException e) {
    assertTextPresent("foo", e.getMessage());
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:20,代码来源:FilterAuthorizationsTest.java

示例2: createAssignedTaskQuery

import org.camunda.bpm.engine.filter.Filter; //导入方法依赖的package包/类
/**
 * creates a task query to select task to the logged in user.
 * Otherwise you would have to manually create a filter in TaskList after each boot up
 */
private void createAssignedTaskQuery() {
    TaskQuery query = taskService.createTaskQuery().taskAssignee(adminUsername);
    Filter taskFilter = filterService.newTaskFilter("assigned Tasks");
    taskFilter.setOwner(adminUsername);
    taskFilter.setQuery(query);
    filterService.saveFilter(taskFilter);
}
 
开发者ID:Educama,项目名称:Showcase,代码行数:12,代码来源:DefaultUserLifecycleBean.java

示例3: testDefaultFilterAuthorization

import org.camunda.bpm.engine.filter.Filter; //导入方法依赖的package包/类
public void testDefaultFilterAuthorization() {
  // create two other users beside testUser
  User ownerUser = createTestUser("ownerUser");
  User anotherUser = createTestUser("anotherUser");

  // grant testUser create permission
  grantCreateFilter();

  // create a new filter with ownerUser as owner
  Filter filter = filterService.newTaskFilter("testFilter");
  filter.setOwner(ownerUser.getId());
  filterService.saveFilter(filter);

  assertFilterPermission(Permissions.CREATE, testUser, null, true);
  assertFilterPermission(Permissions.CREATE, ownerUser, null, false);
  assertFilterPermission(Permissions.CREATE, anotherUser, null, false);

  assertFilterPermission(Permissions.UPDATE, testUser, filter.getId(), false);
  assertFilterPermission(Permissions.UPDATE, ownerUser, filter.getId(), true);
  assertFilterPermission(Permissions.UPDATE, anotherUser, filter.getId(), false);

  assertFilterPermission(Permissions.READ, testUser, filter.getId(), false);
  assertFilterPermission(Permissions.READ, ownerUser, filter.getId(), true);
  assertFilterPermission(Permissions.READ, anotherUser, filter.getId(), false);

  assertFilterPermission(Permissions.DELETE, testUser, filter.getId(), false);
  assertFilterPermission(Permissions.DELETE, ownerUser, filter.getId(), true);
  assertFilterPermission(Permissions.DELETE, anotherUser, filter.getId(), false);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:30,代码来源:FilterAuthorizationsTest.java

示例4: testCreateFilterGenericOwnerId

import org.camunda.bpm.engine.filter.Filter; //导入方法依赖的package包/类
public void testCreateFilterGenericOwnerId() {
  grantCreateFilter();

  Filter filter = filterService.newTaskFilter("someName");
  filter.setOwner("*");

  try {
    filterService.saveFilter(filter);
    fail("exception expected");
  } catch (ProcessEngineException e) {
    assertTextPresent("Cannot create default authorization for filter owner *: "
        + "id cannot be *. * is a reserved identifier.", e.getMessage());
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:15,代码来源:FilterAuthorizationsTest.java

示例5: updateFilter

import org.camunda.bpm.engine.filter.Filter; //导入方法依赖的package包/类
public void updateFilter(Filter filter, ProcessEngine engine) {
  if (getResourceType() != null && !getResourceType().equals(filter.getResourceType())) {
    throw new InvalidRequestException(Status.BAD_REQUEST, "Unable to update filter from resource type '" + filter.getResourceType() + "' to '" + getResourceType() + "'");
  }
  filter.setName(getName());
  filter.setOwner(getOwner());
  filter.setQuery(query.toQuery(engine));
  filter.setProperties(getProperties());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:10,代码来源:FilterDto.java


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