org.graylog.plugins.views.search.rest.ViewsRestPermissions Maven / Gradle / Ivy
/**
* This file is part of Graylog.
*
* Graylog is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Graylog is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Graylog. If not, see .
*/
package org.graylog.plugins.views.search.rest;
import com.google.common.collect.ImmutableSet;
import org.graylog2.plugin.security.Permission;
import org.graylog2.plugin.security.PluginPermissions;
import java.util.Collections;
import java.util.Set;
import static org.graylog2.plugin.security.Permission.create;
public class ViewsRestPermissions implements PluginPermissions {
public static final String VIEW_READ = "view:read";
public static final String VIEW_EDIT = "view:edit";
public static final String VIEW_DELETE = "view:delete";
public static final String DEFAULT_VIEW_SET = "default-view:set";
private final ImmutableSet permissions = ImmutableSet.of(
create(VIEW_READ, "Read available views"),
create(VIEW_EDIT, "Edit view"),
create(VIEW_DELETE, "Delete view"),
create(DEFAULT_VIEW_SET, "Set default view")
);
@Override
public Set permissions() {
return permissions;
}
@Override
public Set readerBasePermissions() {
return Collections.emptySet();
}
}