public ResultMessage execute(ClientState state) throws RequestValidationException, RequestExecutionException { DatabaseDescriptor.getAuthorizer().grant(state.getUser(), permissions, resource, grantee); return null; } }
public ResultMessage execute(ClientState state) throws RequestValidationException, RequestExecutionException { DatabaseDescriptor.getAuthorizer().grant(state.getUser(), permissions, resource, grantee); return null; } }
public ResultMessage execute(ClientState state) throws RequestValidationException, RequestExecutionException { DatabaseDescriptor.getAuthorizer().grant(state.getUser(), permissions, resource, username); return null; } }
public ResultMessage execute(ClientState state) throws RequestValidationException, RequestExecutionException { DatabaseDescriptor.getAuthorizer().grant(state.getUser(), permissions, resource, grantee); return null; } }
protected void grantPermissionsToCreator(QueryState state) { try { IResource resource = FunctionResource.function(functionName.keyspace, functionName.name, argTypes); DatabaseDescriptor.getAuthorizer().grant(AuthenticatedUser.SYSTEM_USER, resource.applicablePermissions(), resource, RoleResource.role(state.getClientState().getUser().getName())); } catch (RequestExecutionException e) { throw new RuntimeException(e); } }
protected void grantPermissionsToCreator(QueryState state) { try { IResource resource = FunctionResource.function(functionName.keyspace, functionName.name, argTypes); DatabaseDescriptor.getAuthorizer().grant(AuthenticatedUser.SYSTEM_USER, resource.applicablePermissions(), resource, RoleResource.role(state.getClientState().getUser().getName())); } catch (RequestExecutionException e) { throw new RuntimeException(e); } }
protected void grantPermissionsToCreator(QueryState state) { try { IResource resource = FunctionResource.function(functionName.keyspace, functionName.name, argTypes); DatabaseDescriptor.getAuthorizer().grant(AuthenticatedUser.SYSTEM_USER, resource.applicablePermissions(), resource, RoleResource.role(state.getClientState().getUser().getName())); } catch (RequestExecutionException e) { throw new RuntimeException(e); } }
protected void grantPermissionsToCreator(QueryState state) { try { IResource resource = FunctionResource.function(functionName.keyspace, functionName.name, argTypes); DatabaseDescriptor.getAuthorizer().grant(AuthenticatedUser.SYSTEM_USER, resource.applicablePermissions(), resource, RoleResource.role(state.getClientState().getUser().getName())); } catch (RequestExecutionException e) { throw new RuntimeException(e); } }
protected void grantPermissionsToCreator(QueryState state) { try { IResource resource = FunctionResource.function(functionName.keyspace, functionName.name, argTypes); DatabaseDescriptor.getAuthorizer().grant(AuthenticatedUser.SYSTEM_USER, resource.applicablePermissions(), resource, RoleResource.role(state.getClientState().getUser().getName())); } catch (RequestExecutionException e) { throw new RuntimeException(e); } }
protected void grantPermissionsToCreator(QueryState state) { try { IResource resource = FunctionResource.function(functionName.keyspace, functionName.name, argTypes); DatabaseDescriptor.getAuthorizer().grant(AuthenticatedUser.SYSTEM_USER, resource.applicablePermissions(), resource, RoleResource.role(state.getClientState().getUser().getName())); } 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); } } }
protected void grantPermissionsToCreator(QueryState state) { try { IResource resource = DataResource.table(keyspace(), columnFamily()); DatabaseDescriptor.getAuthorizer().grant(AuthenticatedUser.SYSTEM_USER, resource.applicablePermissions(), resource, RoleResource.role(state.getClientState().getUser().getName())); } 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 { IResource resource = DataResource.table(keyspace(), columnFamily()); DatabaseDescriptor.getAuthorizer().grant(AuthenticatedUser.SYSTEM_USER, resource.applicablePermissions(), resource, RoleResource.role(state.getClientState().getUser().getName())); } catch (RequestExecutionException e) { throw new RuntimeException(e); } }
protected void grantPermissionsToCreator(QueryState state) { try { IResource resource = DataResource.table(keyspace(), columnFamily()); DatabaseDescriptor.getAuthorizer().grant(AuthenticatedUser.SYSTEM_USER, resource.applicablePermissions(), resource, RoleResource.role(state.getClientState().getUser().getName())); } catch (RequestExecutionException e) { throw new RuntimeException(e); } }
/** * Grant all applicable permissions on the newly created role to the user performing the request * see also: SchemaAlteringStatement#grantPermissionsToCreator and the overridden implementations * of it in subclasses CreateKeyspaceStatement & CreateTableStatement. * @param state */ private void grantPermissionsToCreator(ClientState state) { // The creator of a Role automatically gets ALTER/DROP/AUTHORIZE permissions on it if: // * the user is not anonymous // * the configured IAuthorizer supports granting of permissions (not all do, AllowAllAuthorizer doesn't and // custom external implementations may not) if (!state.getUser().isAnonymous()) { try { DatabaseDescriptor.getAuthorizer().grant(AuthenticatedUser.SYSTEM_USER, role.applicablePermissions(), role, RoleResource.role(state.getUser().getName())); } catch (UnsupportedOperationException e) { // not a problem, grant is an optional method on IAuthorizer } } } }
/** * Grant all applicable permissions on the newly created role to the user performing the request * see also: SchemaAlteringStatement#grantPermissionsToCreator and the overridden implementations * of it in subclasses CreateKeyspaceStatement & CreateTableStatement. * @param state */ private void grantPermissionsToCreator(ClientState state) { // The creator of a Role automatically gets ALTER/DROP/AUTHORIZE permissions on it if: // * the user is not anonymous // * the configured IAuthorizer supports granting of permissions (not all do, AllowAllAuthorizer doesn't and // custom external implementations may not) if (!state.getUser().isAnonymous()) { try { DatabaseDescriptor.getAuthorizer().grant(AuthenticatedUser.SYSTEM_USER, role.applicablePermissions(), role, RoleResource.role(state.getUser().getName())); } catch (UnsupportedOperationException e) { // not a problem, grant is an optional method on IAuthorizer } } } }
/** * Grant all applicable permissions on the newly created role to the user performing the request * see also: SchemaAlteringStatement#grantPermissionsToCreator and the overridden implementations * of it in subclasses CreateKeyspaceStatement & CreateTableStatement. * @param state */ private void grantPermissionsToCreator(ClientState state) { // The creator of a Role automatically gets ALTER/DROP/AUTHORIZE permissions on it if: // * the user is not anonymous // * the configured IAuthorizer supports granting of permissions (not all do, AllowAllAuthorizer doesn't and // custom external implementations may not) if (!state.getUser().isAnonymous()) { try { DatabaseDescriptor.getAuthorizer().grant(AuthenticatedUser.SYSTEM_USER, role.applicablePermissions(), role, RoleResource.role(state.getUser().getName())); } catch (UnsupportedOperationException e) { // not a problem, grant is an optional method on IAuthorizer } } } }