Java Code Examples for hudson.model.TopLevelItem#hasPermission()

The following examples show how to use hudson.model.TopLevelItem#hasPermission() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SecuredMockFolder.java    From jenkins-test-harness with MIT License 5 votes vote down vote up
@Override
public TopLevelItem getItem(String name) {
    final TopLevelItem item = super.getItem(name);
    if (item != null && item.hasPermission(Item.READ)) {
        return item;
    }
    return null;
}
 
Example 2
Source File: AuthenticatedView.java    From DotCi with MIT License 5 votes vote down vote up
@Override
public Collection<TopLevelItem> getItems() {
    final List<TopLevelItem> items = new LinkedList<>();
    for (final TopLevelItem item : getOwnerItemGroup().getItems()) {
        if (item.hasPermission(Job.CONFIGURE)) {
            items.add(item);
        }
    }
    return Collections.unmodifiableList(items);
}
 
Example 3
Source File: MyBuildsView.java    From DotCi with MIT License 5 votes vote down vote up
@Override
public Collection<TopLevelItem> getItems() {
    final List<TopLevelItem> items = new LinkedList<>();
    for (final TopLevelItem item : getOwnerItemGroup().getItems()) {
        if (item.hasPermission(Job.CONFIGURE)) {
            items.add(item);
        }
    }
    return Collections.unmodifiableList(items);
}
 
Example 4
Source File: AuthenticatedView.java    From DotCi with MIT License 4 votes vote down vote up
@Override
public boolean contains(final TopLevelItem item) {
    return item.hasPermission(Job.CONFIGURE);
}
 
Example 5
Source File: MyBuildsView.java    From DotCi with MIT License 4 votes vote down vote up
@Override
public boolean contains(final TopLevelItem item) {
    return item.hasPermission(Job.CONFIGURE);
}