-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcreate_role_groups.sh
More file actions
executable file
·30 lines (26 loc) · 1.04 KB
/
Copy pathcreate_role_groups.sh
File metadata and controls
executable file
·30 lines (26 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
#
# create_role_groups.sh
#
# Create or update one OBP Group per Role Group column (R onwards) of
# min_field_matrix.xlsx by running create_role_groups.py. Each group holds the
# dynamic entity record Roles its column ticks (C/R/U/D per entity), at the bank
# id of the entities' space (OBP_ENTITY_SPACE_ID, or SYS for system level).
# All arguments are passed through.
#
# Usage:
# ./create_role_groups.sh [path/to/min_field_matrix.xlsx] [--dry-run]
#
# Notes:
# - Credentials/host come from your .env, same as the Python scripts.
# - Members stay in their groups: they are granted only Roles new to them
# (one email each) and lose the ones taken out of the group.
set -euo pipefail
# Run from the directory this script lives in, so relative paths resolve.
cd "$(dirname "$0")"
# Prefer the project virtualenv if it exists (has pandas/openpyxl/requests installed).
if [ -z "${PYTHON:-}" ] && [ -x ".venv/bin/python" ]; then
PYTHON=".venv/bin/python"
fi
PYTHON="${PYTHON:-python3}"
exec "$PYTHON" create_role_groups.py "$@"