You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+173-50
Original file line number
Diff line number
Diff line change
@@ -4,67 +4,99 @@ This is a set of Python tools for helping with the migration from FOLIO OKAPI pl
4
4
5
5
# Installation
6
6
7
+
Copy .env.example over to .env and populate with your local settings.
8
+
7
9
```bash
8
10
source .venv/bin/activate
9
11
pip install -r requirements.txt
10
12
```
11
13
12
-
# Scripts
13
-
14
-
## Get OKAPI Permissions
14
+
# Running
15
15
16
-
!!! Run First !!!
17
-
This script needs to be ran first to pull all the permission sets from an OKAPI instance of FOLIO. By Default Ramsons BugFest has been added to the .env file.
16
+
There is an interactive menu that has been added to make it easier to run the included scripts. This menu can be accessed by running:
18
17
19
-
### Running the script:
20
18
21
19
```bash
22
-
python ./pullOkapiPermissions.py
20
+
python ./main.py
23
21
```
24
22
25
-
## Get Eureka Permissions
23
+
## Menu options
26
24
27
-
!!! Run First !!!
25
+
### 1. Pull Reference Data:
28
26
29
-
This script pulls the Capabilities and Capability Sets from the Eureka platform and saves them in JSON format to be used later.
27
+
This menu option runs four scripts:
28
+
- Script one pulls all OKAPI permissions.
29
+
- Script two pulls all EUREKA Capabilities .
30
+
- Script three pulls all EUREKA Capability Sets.
31
+
- Script four pulls all OKAPI User Permissions from your reference environment.
30
32
31
-
-_At this time i can not log in via the API, so the JSON was pulled via the web interface and saved into a JSON file._
33
+
### 2. Build Comparisons:
32
34
33
-
### Running the script:
35
+
This menu option runs three comparison scripts against the data pulled in the first menu option.
36
+
- Script one add all the sub capability data to the capability sets; this option also generates a web page displaying tthe data in an easy to read format.
37
+
- Script two compares permissions to capabilities.
38
+
- Script three builds a comparison of current user permission sets to capabilities.
34
39
35
-
```bash
36
-
python ./pullOkapiPermissions.py
37
-
```
40
+
### 3. Build Working CSV and HTML File:
38
41
39
-
## Get Production Permission Sets
42
+
This menu option runs two scripts that builds upon the data generated in the second menu option.
43
+
- Script one looks at the data generated from comaring the current user permissions to capabilities and looks to see what capability sets could be used to fullfill the orginal permission sets. This file can be edited and resubmitted.
44
+
- Script two creates the "FOLIO Roles Simulator" web interface. This uses the data collected in the previous steps to create a dynamic web interface to test creating roles.
40
45
41
-
This script pulls the current permission sets form your reference system and saves them in JSON format.
42
46
43
-
### Running the script:
47
+
### 4. Reprocess the Capability Set Selection File (csv):
44
48
45
-
```bash
46
-
python ./pullReferenceData.py
47
-
```
49
+
This menu option takes the CSV file generated in menu option 3 and re-precesses it.
48
50
49
-
##Compare OKAPI to Eureka
51
+
### 5. Run a Specific Script:
50
52
51
-
This script pulls the Capability Sets and uses the published names to match them to a OKAPI permission set. It expands on the included capabilities and permissions to show the names and UUIDS. Two files are generated:
52
-
`FILE_COMPARED_SETS_TO_PERMISSIONS`: JSON file with all the collected data
53
-
`FILE_COMPARED_SETS_TO_PERMISSIONS_CSV`: CV file that can be opened in Excel for easier viewing. the first row is are the headers. The data is formatted as:
53
+
Each of theses menu options are outlined below.
54
54
55
-
**Eureka capability set**: _id name type resource description action_
55
+
-**Pull Reference Data - OKAPI Permissions**:
56
+
-**Pull Reference Data - Capability Sets**:
57
+
-**Pull Reference Data - Capabilities**:
58
+
-**Pull Reference Data - OKAPI Permission Sets**:
59
+
-**Expand Capability Sets**:
60
+
-**Compare OKAPI Permissions to Eureka Capabilities**:
61
+
-**Compare Current User Permission Sets to Eureka Capabilities**:
62
+
-**Find Possible Capability Matches to OKAPI Permissions**:
63
+
-**Build Web Interface - FOLIO Roles Simulator**:
64
+
-**Reprocess the Capability Set Selection File (csv)**:
**OKAPI sub permissions (if a Matching permission set is found)**: _okapiSubPermissions.name okapiSubPermissions.description okapiSubPermissions.permissionName_
62
70
63
-
### Running the script:
71
+
#Individual Scripts
64
72
65
-
```bash
66
-
python ./compareOkapiToEureka.py
67
-
```
73
+
## Data Retrieval Functions
74
+
75
+
## Pull Reference Data - OKAPI Permissions
76
+
77
+
!!! Run First !!!
78
+
This script needs to be ran first to pull all the permission sets from an OKAPI instance of FOLIO. By Default Ramsons BugFest has been added to the .env file.
79
+
80
+
## Pull Reference Data - Capability Sets
81
+
82
+
!!! Run First !!!
83
+
84
+
This script pulls the Capability Sets from the Eureka platform and saves them in JSON format to be used later.
85
+
86
+
-_At this time i can not log in via the API, so the JSON was pulled via the web interface and saved into a JSON file._
87
+
88
+
## Pull Reference Data - Capabilities
89
+
90
+
!!! Run First !!!
91
+
92
+
This script pulls the Capabilities from the Eureka platform and saves them in JSON format to be used later.
93
+
94
+
## Pull Reference Data - OKAPI Permission Sets
95
+
96
+
This script pulls the current permission sets form your reference system and saves them in JSON format. The reference system should be a production or test system with a current set of user permission sets.
97
+
98
+
---
99
+
## Data Formatting Functions
68
100
69
101
## Expanded Capability Sets
70
102
@@ -76,13 +108,22 @@ This scripts takes the Capability set data and expands out the linked capabiliti
76
108
-`FILE_EUREKA_CAPABILITY_SETS_EXPANDED_CSV`: CSV file of the same data set.
77
109
-`FILE_EUREKA_CAPABILITY_SETS_EXPANDED_HTML`: HTML Table view that can be opened directly in the browser or saved to Confluence.
78
110
79
-
### Running the script:
111
+
## Compare OKAPI Permissions to Eureka Capabilities
112
+
113
+
This script pulls the Capability Sets and uses the published names to match them to a OKAPI permission set. It expands on the included capabilities and permissions to show the names and UUIDS. Two files are generated:
114
+
`FILE_COMPARED_SETS_TO_PERMISSIONS`: JSON file with all the collected data
115
+
`FILE_COMPARED_SETS_TO_PERMISSIONS_CSV`: CV file that can be opened in Excel for easier viewing. the first row is are the headers. The data is formatted as:
116
+
117
+
**Eureka capability set**: _id name type resource description action_
**OKAPI sub permissions (if a Matching permission set is found)**: _okapiSubPermissions.name okapiSubPermissions.description okapiSubPermissions.permissionName_
80
124
81
-
```bash
82
-
python ./expandCapabilitySets.py
83
-
```
84
125
85
-
## Compare Current Permissions to Capability Sets
126
+
## Compare Current User Permission Sets to Eureka Capabilities
86
127
87
128
This script takes current permission sets in the reference environment (visible, and mutable) expands the sub permissions. During this process it adds the supervision name, and description if they are included. it also looks to see if there is a matching capability, and lists that data.
88
129
This should allow a user to re-create a permission set using just capabilities.
@@ -92,15 +133,10 @@ This should allow a user to re-create a permission set using just capabilities.
92
133
-`FILE_COMPARED_CURRENT_TO_CAPABILITIES`: JSON version of the expanded data
93
134
-`FILE_COMPARED_CURRENT_TO_CAPABILITIES_CSV`: CSV version of the same data set
94
135
136
+
---
137
+
## Create Working Documents
95
138
96
-
97
-
### Running the script:
98
-
99
-
```bash
100
-
python ./compareCurrentToCapabilities.py
101
-
```
102
-
103
-
## Find possible compatibility sets
139
+
## Find Possible Capability Matches to OKAPI Permissions
104
140
105
141
This script will look that the JSON generated from `compareCurrentToCapabilities.py` and compare the assigned Compatibility sets and rank what set may bes fit in a new role that will match the Permission Set. It does this by looking at the capability Sets individual capabilitys and then matches thos to the ones in the permission set. The fallowing data will be added:
106
142
@@ -117,6 +153,33 @@ Items with a rank of 0 or lower then X will be ignored.
117
153
-`FILE_COMPARED_CURRENT_TO_CAPABILITIES`: JSON version of the expanded data
118
154
-`FILE_COMPARED_CURRENT_TO_CAPABILITIES_CSV`: CSV version of the same data set
119
155
156
+
## Build Web Interface - FOLIO Roles Simulator
157
+
158
+
This script will take the data produced in the previous scripts and generate a web interface that allows a user to pull up a current Permission Set and rebuild it using Capability Sets and Capabilities. No server is required to run this page it runs entirely in the users browser.
159
+
160
+
### How to use
161
+
162
+
- Open the generated HTML in the browser of you choice (tested with Chrome)
163
+
- Select a Permission Set from the drop down in the left hand side of the screen. (red arrow)
164
+
- Using the interface on the right side of the screen first start to select Capability sets to fill in the majority of your missing capabilities, for your permission set. (blue arrow)
165
+
- Use the Capabilities section to fill any smaller gaps. (blue arrow)
166
+
167
+

168
+
169
+
In this image you can see that the Permission Set "Acq Unopen Reopen" has been selected. The three sections under the selection box are:
170
+
- Missing Capabilities: Theres are the capabilites that the scripts have identifed that are needed to re-create the permission set, btu are currently missing. In this example since no Capability Sets or Capabilities are selected all sub Capabilities are displayed.
171
+
- Extra Capabilities: These are capabilities that where added by selecting either Capability Sets or Capabilities on the left.
172
+
- Assigned Capabilities: These are the currently assigned capabilities based on what has been selected on the left.
173
+
174
+

175
+
176
+
This image depicts what happens after a user has selected a Capability Set on the left. The 3 areas are adjusted to show the most current information.
177
+
178
+

179
+
180
+
181
+
## Reprocess the Capability Set Selection File (csv)
182
+
120
183
# Contributing
121
184
122
185
Pull requests are welcome. For major changes, please open an issue first
@@ -125,10 +188,70 @@ to discuss what you would like to change.
125
188
Please also fork as needed.
126
189
127
190
# .env File
128
-
FILE_OKAPI_PERMISSIONS: Location of the OKAPI permissions JSON file. This will be used fro reading and writing depending on the script ran.
129
-
FILE_EUREKA_CAPABILITY_SETS = Location of the Eureka Capability Sets JSON file. This will be used fro reading and writing depending on the script ran.
130
-
FILE_EUREKA_CAPABILITIES = Location of the Eureka Capabilities JSON file. This will be used fro reading and writing depending on the script ran.
131
-
FILE_COMPARED_SETS_TO_PERMISSIONS = Location of the OKAPI to Eureka Capability Set comparisons JSON file. This will be used fro reading and writing depending on the script ran.
191
+
192
+
## OKAPI Env
193
+
194
+
These env variables are for your OKAPI reference environment. I suggest using bugfest as you want this data to be as up-to-date as possible.
195
+
196
+
`OKAPI_URL` =
197
+
198
+
`OKAPI_TENANT` =
199
+
200
+
`OKAPI_USER` =
201
+
202
+
`OKAPI_PASSWORD` =
203
+
204
+
## Eureka Env
205
+
206
+
These env variables are for your Eureka reference environment. I suggest using snapshot or bugfest as you want this data to be as up-to-date as possible.
207
+
208
+
`EUREKA_URL` =
209
+
210
+
`EUREKA_TENANT` =
211
+
212
+
`EUREKA_USER` =
213
+
214
+
`EUREKA_PASSWORD` =
215
+
216
+
## Reference OKAPI Env
217
+
218
+
These env variables are for your production or test environment. They user accout will need permissions to read Permission data. This connection is used to pull your current Permission Sets.
219
+
220
+
`REF_OKAPI_URL` =
221
+
222
+
`REF_OKAPI_TENANT` =
223
+
224
+
`REF_OKAPI_USER` =
225
+
226
+
`REF_OKAPI_PASSWORD` =
227
+
228
+
## Reference server - Production or test server with real permission data in it.
229
+
230
+
These final settings are where files will be stored on your machine. to be safe it is suggested that you use absolute directory paths.
231
+
232
+
`BASE_DIR` = Base directory where all file will be stored.
233
+
234
+
`FILE_OKAPI_PERMISSIONS` = Location of the OKAPI permissions JSON file. This will be used fro reading and writing depending on the script ran.
235
+
236
+
`FILE_REF_OKAPI_PERMISSIONS` =
237
+
238
+
`FILE_EUREKA_CAPABILITY_SETS` = Location of the Eureka Capability Sets JSON file. This will be used fro reading and writing depending on the script ran.
239
+
240
+
`FILE_EUREKA_CAPABILITIES` = Location of the Eureka Capabilities JSON file. This will be used fro reading and writing depending on the script ran.
241
+
242
+
`FILE_EUREKA_CAPABILITY_SETS_EXPANDED` =
243
+
244
+
`FILE_COMPARED_SETS_TO_PERMISSIONS` = Location of the OKAPI to Eureka Capability Set comparisons JSON file. This will be used fro reading and writing depending on the script ran.
Copy file name to clipboardExpand all lines: main.py
+1-1
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ def main():
41
41
sub_menu_items= [
42
42
"Pull Reference Data - OKAPI Permissions", "Pull Reference Data - Capability Sets", "Pull Reference Data - Capabilities", "Pull Reference Data - OKAPI Permission Sets"
43
43
"Expand Capability Sets", "Compare OKAPI Permissions to Eureka Capabilities", "Compare Current User Permission Sets to Eureka Capabilities",
44
-
"Find Possible Capability Matches to OKAPI Permissions", "Build Web Interface - FOLIO Roles Simulator", "Reprocess the Capability Set Selection File (csv)"
44
+
"Find Possible Capability Matches to OKAPI Permissions", "Build Web Interface - FOLIO Roles Simulator", "Reprocess the Capability Set Selection File (csv)", "Main Menu"
0 commit comments