Search in sources :

Example 1 with PluginPermissions

use of org.graylog2.plugin.security.PluginPermissions in project graylog2-server by Graylog2.

the class PermissionsTest method testPluginPermissions.

@Test
public void testPluginPermissions() throws Exception {
    final ImmutableSet<Permission> pluginPermissions = ImmutableSet.of(Permission.create("foo:bar", "bar"), Permission.create("foo:baz", "baz"), Permission.create("hello:world", "hello"));
    final PermissionsPluginPermissions plugin = new PermissionsPluginPermissions(pluginPermissions);
    final Permissions permissions = new Permissions(ImmutableSet.of(restPermissions, plugin));
    assertThat(permissions.allPermissionsMap().get("foo")).containsOnly("bar", "baz");
    assertThat(permissions.allPermissionsMap().get("hello")).containsOnly("world");
}
Also used : Permission(org.graylog2.plugin.security.Permission) PluginPermissions(org.graylog2.plugin.security.PluginPermissions) Test(org.junit.Test)

Aggregations

Permission (org.graylog2.plugin.security.Permission)1 PluginPermissions (org.graylog2.plugin.security.PluginPermissions)1 Test (org.junit.Test)1