Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add help cards for security commands #1027

Merged
merged 2 commits into from
Jan 2, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions src/browser/documentation/help/alter-user.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/*
* Copyright (c) 2002-2019 "Neo4j,"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react'
import ManualLink from 'browser-components/ManualLink'
import AdminOnSystemDb from './partials/admin-on-systemdb'
const title = 'ALTER USER'
const subtitle = 'Modify a user'
const category = 'administration'
const content = (
<>
<p>
The command <code>ALTER USER</code> can be used to modify an existing
nglgzz marked this conversation as resolved.
Show resolved Hide resolved
user.
</p>
<div className="links">
<div className="link">
<p className="title">Reference</p>
<p className="content">
<ManualLink
chapter="cypher-manual"
page="/administration/security/users-and-roles/#administration-security-users-alter"
minVersion="4.0.0"
>
ALTER USER
</ManualLink>{' '}
manual page
</p>
</div>
<div className="link">
<p className="title">Related</p>
<p className="content">
<a help-topic="show-users">:help SHOW USERS</a>{' '}
<a help-topic="create-user">:help CREATE USER</a>{' '}
<a help-topic="drop-user">:help DROP USER</a>{' '}
<a help-topic="cypher">:help Cypher</a>
</p>
</div>
</div>
<section className="example">
<figure>
<pre className="code runnable standalone-example">
ALTER USER jake SET PASSWORD 'abc123'
<br />
CHANGE NOT REQUIRED SET STATUS
<br />
ACTIVE
</pre>
<figcaption>
Modify the user jake with a new password and active status as well as
remove the requirement to change his password.
</figcaption>
</figure>
<figure>
<pre className="code runnable standalone-example">
ALTER CURRENT USER SET PASSWORD FROM 'abc123' TO '123xyz'
</pre>
<figcaption>
Users can change their own password using ALTER CURRENT USER SET
PASSWORD. The old password is required in addition to the new one, and
either or both can be a string value or a string parameter. When a
user executes this command it will change their password as well as
set the CHANGE NOT REQUIRED flag.
</figcaption>
</figure>
</section>
<AdminOnSystemDb />
</>
)
export default { title, subtitle, category, content }
75 changes: 75 additions & 0 deletions src/browser/documentation/help/create-role.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* Copyright (c) 2002-2019 "Neo4j,"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react'
import ManualLink from 'browser-components/ManualLink'
import AdminOnSystemDb from './partials/admin-on-systemdb'
const title = 'CREATE ROLE'
const subtitle = 'Create a new role'
const category = 'security'
const content = (
<>
<p>
The <code>CREATE ROLE</code> command can be used to create roles.
</p>
<div className="links">
<div className="link">
<p className="title">Reference</p>
<p className="content">
<ManualLink
chapter="cypher-manual"
page="/administration/security/users-and-roles/#administration-security-roles-create"
minVersion="4.0.0"
>
CREATE ROLE
</ManualLink>{' '}
manual page
</p>
</div>
<div className="link">
<p className="title">Related</p>
<p className="content">
<a help-topic="show-roles">:help SHOW ROLES</a>{' '}
<a help-topic="drop-role">:help DROP ROLE</a>{' '}
<a help-topic="grant-role">:help GRANT ROLE</a>{' '}
<a help-topic="revoke-role">:help REVOKE ROLE</a>{' '}
<a help-topic="cypher">:help Cypher</a>
</p>
</div>
</div>
<section className="example">
<figure>
<pre className="code runnable standalone-example">
CREATE ROLE myrole
</pre>
</figure>
<figure>
<pre className="code runnable standalone-example">
CREATE ROLE mysecondrole AS COPY OF myrole
</pre>
<figcaption>
A role can also be copied, keeping its privileges.
</figcaption>
</figure>
</section>
<AdminOnSystemDb />
</>
)
export default { title, subtitle, category, content }
1 change: 1 addition & 0 deletions src/browser/documentation/help/create-user.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const content = (
<p className="title">Related</p>
<p className="content">
<a help-topic="show-users">:help SHOW USERS</a>{' '}
<a help-topic="alter-user">:help ALTER USER</a>{' '}
<a help-topic="drop-user">:help DROP USER</a>{' '}
<a help-topic="cypher">:help Cypher</a>
</p>
Expand Down
88 changes: 88 additions & 0 deletions src/browser/documentation/help/deny.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*
* Copyright (c) 2002-2019 "Neo4j,"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react'
import ManualLink from 'browser-components/ManualLink'
import AdminOnSystemDb from './partials/admin-on-systemdb'
const title = 'DENY'
const subtitle = 'Deny privileges to roles'
const category = 'security'
const content = (
<>
<p>
The <code>DENY</code> command allows an administrator to deny a privilege
to a role in order to prevent access to an entity.
</p>
<div className="links">
<div className="link">
<p className="title">Reference</p>
<p className="content">
<ManualLink
chapter="cypher-manual"
page="/administration/security/subgraph/#administration-security-subgraph-introduction"
minVersion="4.0.0"
>
Subgraph security
</ManualLink>{' '}
manual page
<br />
<ManualLink
chapter="cypher-manual"
page="/administration/security/administration/#administration-security-administration-database-privileges"
minVersion="4.0.0"
>
Database administration
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume there isnt a specific DENY section?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see there are a few others like this too

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct. GRANT, DENY, and REVOKE are together in two different sections. One for DB administration (limiting access to specific databases), and the other one for subgraph administration (limiting what kind of queries a role can do).

</ManualLink>{' '}
manual page
</p>
</div>
<div className="link">
<p className="title">Related</p>
<p className="content">
<a help-topic="show-privileges">:help SHOW PRIVILEGES</a>{' '}
<a help-topic="grant">:help GRANT</a>{' '}
<a help-topic="revoke">:help REVOKE</a>{' '}
<a help-topic="cypher">:help Cypher</a>
</p>
</div>
</div>
<section className="example">
<figure>
<pre className="code runnable standalone-example">
DENY graph-privilege ON GRAPH dbname entity TO role
</pre>
<figcaption>
Deny a subgraph privilege to a role (eg. write nodes/relationships).
</figcaption>
</figure>
<figure>
<pre className="code runnable standalone-example">
DENY database-privilege ON DATABASE dbname TO role
</pre>
<figcaption>
Deny a database administrative privilege to a role (eg. create index
or start/stop database).
</figcaption>
</figure>
</section>
<AdminOnSystemDb />
</>
)
export default { title, subtitle, category, content }
65 changes: 65 additions & 0 deletions src/browser/documentation/help/drop-role.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
* Copyright (c) 2002-2019 "Neo4j,"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react'
import ManualLink from 'browser-components/ManualLink'
import AdminOnSystemDb from './partials/admin-on-systemdb'
const title = 'DROP ROLE'
const subtitle = 'Delete a role'
const category = 'security'
const content = (
<>
<p>
The <code>DROP ROLE</code> command can be used to delete roles.
</p>
<div className="links">
<div className="link">
<p className="title">Reference</p>
<p className="content">
<ManualLink
chapter="cypher-manual"
page="/administration/security/users-and-roles/#administration-security-roles-drop"
minVersion="4.0.0"
>
DROP ROLE
</ManualLink>{' '}
manual page
</p>
</div>
<div className="link">
<p className="title">Related</p>
<p className="content">
<a help-topic="show-roles">:help SHOW ROLES</a>{' '}
<a help-topic="create-role">:help CREATE ROLE</a>{' '}
<a help-topic="grant-role">:help GRANT ROLE</a>{' '}
<a help-topic="revoke-role">:help REVOKE ROLE</a>{' '}
<a help-topic="cypher">:help Cypher</a>
</p>
</div>
</div>
<section className="example">
<figure>
<pre className="code runnable standalone-example">DROP ROLE myrole</pre>
</figure>
</section>
<AdminOnSystemDb />
</>
)
export default { title, subtitle, category, content }
1 change: 1 addition & 0 deletions src/browser/documentation/help/drop-user.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const content = (
<p className="content">
<a help-topic="show-users">:help SHOW USERS</a>{' '}
<a help-topic="drop-user">:help CREATE USER</a>{' '}
<a help-topic="alter-user">:help ALTER USER</a>{' '}
<a help-topic="cypher">:help Cypher</a>
</p>
</div>
Expand Down
Loading