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");
}
Aggregations