protected void grantPermissionsToCreator(QueryState state) { try { RoleResource role = RoleResource.role(state.getClientState().getUser().getName()); DataResource keyspace = DataResource.keyspace(keyspace()); DatabaseDescriptor.getAuthorizer().grant(AuthenticatedUser.SYSTEM_USER, keyspace.applicablePermissions(), keyspace, role); FunctionResource functions = FunctionResource.keyspace(keyspace()); DatabaseDescriptor.getAuthorizer().grant(AuthenticatedUser.SYSTEM_USER, functions.applicablePermissions(), functions, role); } catch (RequestExecutionException e) { throw new RuntimeException(e); } } }
protected void grantPermissionsToCreator(QueryState state) { try { RoleResource role = RoleResource.role(state.getClientState().getUser().getName()); DataResource keyspace = DataResource.keyspace(keyspace()); DatabaseDescriptor.getAuthorizer().grant(AuthenticatedUser.SYSTEM_USER, keyspace.applicablePermissions(), keyspace, role); FunctionResource functions = FunctionResource.keyspace(keyspace()); DatabaseDescriptor.getAuthorizer().grant(AuthenticatedUser.SYSTEM_USER, functions.applicablePermissions(), functions, role); } catch (RequestExecutionException e) { throw new RuntimeException(e); } } }
protected void grantPermissionsToCreator(QueryState state) { try { RoleResource role = RoleResource.role(state.getClientState().getUser().getName()); DataResource keyspace = DataResource.keyspace(keyspace()); DatabaseDescriptor.getAuthorizer().grant(AuthenticatedUser.SYSTEM_USER, keyspace.applicablePermissions(), keyspace, role); FunctionResource functions = FunctionResource.keyspace(keyspace()); DatabaseDescriptor.getAuthorizer().grant(AuthenticatedUser.SYSTEM_USER, functions.applicablePermissions(), functions, role); } catch (RequestExecutionException e) { throw new RuntimeException(e); } } }