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