Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
FherStk committed Dec 15, 2022
1 parent 062e74b commit f548dc3
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 47 deletions.
89 changes: 51 additions & 38 deletions scripts/templates/permissions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# along with AutoCheck. If not, see <https://www.gnu.org/licenses/>.

name: "ASIX - M02 (UF3): Permissions Assignment"
version: "1.2.0.0"
version: "1.3.0.0"

#TODO: permission reset should be performed ONLY when running on batch mode and ONLY when importing an SQL dump... When using directly over an existing BBDD, it should be just READ ONLY.

Expand All @@ -34,6 +34,7 @@ body:

- question:
description: "Foreign key (I)"
score: 0.5
content:
- run:
caption: "Checking foreign key 'empleats -> empleats'..."
Expand All @@ -44,6 +45,7 @@ body:

- question:
description: "Foreign key (II)"
score: 0.5
content:
- run:
caption: "Checking foreign key 'empleats -> departaments'..."
Expand All @@ -54,6 +56,7 @@ body:

- question:
description: "Privileges over 'empleats'"
score: 1
content:
- run:
caption: "Checking new entries..."
Expand All @@ -77,6 +80,7 @@ body:

- question:
description: "Privileges over 'fabricacio'"
score: 1
content:
- run:
caption: "Checking foreign key 'fabricacio -> fabriques'..."
Expand Down Expand Up @@ -126,48 +130,57 @@ body:

- question:
description: "Privileges for rrhhadmin and prodadmin"
content:
- run:
caption: "Checking removed entries..."
connector: "Postgres"
command: "ExecuteScalar"
arguments: --query "SELECT COUNT(id) FROM rrhh.empleats WHERE id=9"
expected: "0"
score: 2
content:
- question:
description: "Privileges for rrhhadmin"
score: 1
content:
- run:
caption: "Checking removed entries..."
connector: "Postgres"
command: "ExecuteScalar"
arguments: --query "SELECT COUNT(id) FROM rrhh.empleats WHERE id=9"
expected: "0"

- run:
caption: "Checking 'rrhhadmin' privileges for the table 'empleats'..."
connector: "Postgres"
command: "GetTablePrivileges"
arguments: "--schema rrhh --table empleats --role rrhhadmin"
expected: "arwxt"
- run:
caption: "Checking 'rrhhadmin' privileges for the table 'empleats'..."
connector: "Postgres"
command: "GetTablePrivileges"
arguments: "--schema rrhh --table empleats --role rrhhadmin"
expected: "arwxt"

- run:
caption: "Checking 'rrhhadmin' privileges for the table 'departaments'..."
connector: "Postgres"
command: "GetTablePrivileges"
arguments: "--schema rrhh --table departaments --role rrhhadmin"
expected: "arwxt"
- run:
caption: "Checking 'rrhhadmin' privileges for the table 'departaments'..."
connector: "Postgres"
command: "GetTablePrivileges"
arguments: "--schema rrhh --table departaments --role rrhhadmin"
expected: "arwxt"

- run:
caption: "Checking 'prodadmin' privileges for the table 'fabriques'..."
connector: "Postgres"
command: "GetTablePrivileges"
arguments: "--schema produccio --table fabriques --role prodadmin"
expected: "arwxt"
- question:
description: "Privileges for prodadmin"
score: 1
content:
- run:
caption: "Checking 'prodadmin' privileges for the table 'fabriques'..."
connector: "Postgres"
command: "GetTablePrivileges"
arguments: "--schema produccio --table fabriques --role prodadmin"
expected: "arwxt"

- run:
caption: "Checking 'prodadmin' privileges for the table 'productes'..."
connector: "Postgres"
command: "GetTablePrivileges"
arguments: "--schema produccio --table productes --role prodadmin"
expected: "arwxt"
- run:
caption: "Checking 'prodadmin' privileges for the table 'productes'..."
connector: "Postgres"
command: "GetTablePrivileges"
arguments: "--schema produccio --table productes --role prodadmin"
expected: "arwxt"

- run:
caption: "Checking 'prodadmin' privileges for the table 'fabricacio'..."
connector: "Postgres"
command: "GetTablePrivileges"
arguments: "--schema produccio --table fabricacio --role prodadmin"
expected: "arwxt"
- run:
caption: "Checking 'prodadmin' privileges for the table 'fabricacio'..."
connector: "Postgres"
command: "GetTablePrivileges"
arguments: "--schema produccio --table fabricacio --role prodadmin"
expected: "arwxt"

- question:
description: "Privileges for dbadmin"
Expand Down
Loading

0 comments on commit f548dc3

Please sign in to comment.