use of org.graylog2.shared.security.RestPermissions 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");
}
use of org.graylog2.shared.security.RestPermissions in project graylog2-server by Graylog2.
the class PermissionsTest method setUp.
@Before
public void setUp() throws Exception {
restPermissions = new RestPermissions();
permissions = new Permissions(ImmutableSet.of(restPermissions));
}
use of org.graylog2.shared.security.RestPermissions in project graylog2-server by Graylog2.
the class UserServiceImplTest method setUp.
@Before
public void setUp() throws Exception {
this.mongoConnection = mongodb.mongoConnection();
this.configuration = new Configuration();
this.permissions = new Permissions(ImmutableSet.of(new RestPermissions()));
this.userFactory = new UserImplFactory(configuration, permissions);
this.userService = new UserServiceImpl(mongoConnection, configuration, roleService, accessTokenService, userFactory, permissionsResolver, serverEventBus, GRNRegistry.createWithBuiltinTypes(), permissionAndRoleResolver);
when(roleService.getAdminRoleObjectId()).thenReturn("deadbeef");
}
Aggregations