org.graylog.plugins.views.search.rest.ViewsRestPermissions Maven / Gradle / Ivy
/*
* Copyright (C) 2020 Graylog, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the Server Side Public License, version 1,
* as published by MongoDB, Inc.
*
* This program 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
* Server Side Public License for more details.
*
* You should have received a copy of the Server Side Public License
* along with this program. 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();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy