Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
0859fb86
Commit
0859fb86
authored
Oct 13, 2017
by
sim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Database user gargantua don't need to be superuser
parent
04000933
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
4db5dcbe4bc7_bootstrap_access_control_system.py
.../versions/4db5dcbe4bc7_bootstrap_access_control_system.py
+6
-6
psql_configure.sh
install/gargamelle/psql_configure.sh
+1
-1
No files found.
alembic/versions/4db5dcbe4bc7_bootstrap_access_control_system.py
View file @
0859fb86
...
...
@@ -36,13 +36,17 @@ anon_role = ReplaceableObject("anon", "NOLOGIN")
roles
=
[
gargantext_role
,
authenticator_role
,
anon_role
]
grants
=
[
(
'gargantext'
,
'gargantua'
),
# Enable login through PostgREST auth system for gargantua, anon and
# gargantext
(
'gargantua, anon, gargantext'
,
'authenticator'
),
# Basic privileges for gargantext role
(
'USAGE ON SCHEMA api'
,
'gargantext'
),
(
'
CREATE,
USAGE ON SCHEMA api'
,
'gargantext'
),
(
'SELECT ON nodes'
,
'gargantext'
),
(
'UPDATE (parent_id, name, date, hyperdata) ON nodes'
,
'gargantext'
),
(
'INSERT ON nodes'
,
'gargantext'
),
...
...
@@ -90,14 +94,11 @@ def upgrade():
op
.
create_role
(
role
)
op
.
create_view
(
api_nodes_view
)
op
.
execute
(
"ALTER VIEW api.nodes OWNER TO gargantext"
)
# BYPASSRLS is only useful if gargantua is not owner of tables
op
.
execute
(
"ALTER ROLE gargantua WITH BYPASSRLS"
)
for
grant
in
grants
:
op
.
execute
(
'GRANT {} TO {}'
.
format
(
*
grant
))
op
.
execute
(
"ALTER VIEW api.nodes OWNER TO gargantext"
)
op
.
execute
(
"ALTER TABLE nodes ENABLE ROW LEVEL SECURITY"
)
for
sp
in
stored_procedures
:
...
...
@@ -119,7 +120,6 @@ def downgrade():
for
grant
in
grants
:
op
.
execute
(
'REVOKE {} FROM {}'
.
format
(
*
grant
))
op
.
execute
(
"ALTER ROLE gargantua WITH NOBYPASSRLS"
)
op
.
drop_view
(
api_nodes_view
)
for
role
in
roles
:
...
...
install/gargamelle/psql_configure.sh
View file @
0859fb86
...
...
@@ -21,7 +21,7 @@ su postgres -c 'pg_ctlcluster 9.6 main start'
service postgresql start
su postgres
-c
"psql -c
\"
CREATE
user gargantua WITH PASSWORD 'C8kdcUrAQy66U'
\"
"
su postgres
-c
"psql -c
\"
CREATE
USER gargantua PASSWORD 'C8kdcUrAQy66U' CREATEROLE BYPASSRLS
\"
"
su postgres
-c
"createdb -O gargantua gargandb"
echo
"Postgres configured"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment