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
+57-83
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
# Overview
2
2
3
-
This is a set of Python tools for helping with the migration from FOLIO OKAPI platform to FOLIO Eureka platform. A lot of the scripts need to be ran in the order presented below as they build upon each other. I purposely did not combine them into a single function as to allow for the review of data at each step.
3
+
This repository contains a set of Python tools to assist with the migration from the FOLIO OKAPI platform to the FOLIO Eureka platform. Many of the scripts need to be run in the order presented below as they build upon each other. I purposely did not combine them into a single function to allow for the review of data at each step.
4
+
4
5
5
6
# Installation
6
7
@@ -13,7 +14,7 @@ pip install -r requirements.txt
13
14
14
15
# Running
15
16
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:
17
+
An interactive menu has been added to make it easier to run the included scripts. This menu can be accessed by running:
17
18
18
19
19
20
```bash
@@ -23,34 +24,32 @@ python ./main.py
23
24
## Menu options
24
25
25
26
### 1. Pull Reference Data:
26
-
27
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.
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.
32
32
33
33
### 2. Build Comparisons:
34
-
35
34
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.
39
35
40
-
### 3. Build Working CSV and HTML File:
36
+
- Script one adds all the sub-capability data to the capability sets; this option also generates a web page displaying the 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.
39
+
40
+
### 3. Build Working CSV and HTML File:
41
+
This menu option runs two scripts that build upon the data generated in the second menu option.
41
42
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.
43
+
- Script one looks at the data generated from comparing the current user permissions to capabilities and identifies which capability sets could be used to fulfill the original 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.
45
45
46
46
47
47
### 4. Reprocess the Capability Set Selection File (csv):
48
48
49
-
This menu option takes the CSV file generated in menu option 3 and re-precesses it.
49
+
This menu option takes the CSV file generated in menu option 3 and reprocesses it.
50
50
51
51
### 5. Run a Specific Script:
52
-
53
-
Each of theses menu options are outlined below.
52
+
Each of these menu options is outlined below.
54
53
55
54
-**Pull Reference Data - OKAPI Permissions**:
56
55
-**Pull Reference Data - Capability Sets**:
@@ -73,107 +72,87 @@ Each of theses menu options are outlined below.
73
72
## Data Retrieval Functions
74
73
75
74
## 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.
75
+
**Run First!** This script needs to be run 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
76
80
77
## Pull Reference Data - Capability Sets
81
78
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._
79
+
**Run First!** This script pulls the capability sets from the Eureka platform and saves them in JSON format to be used later.
87
80
88
81
## Pull Reference Data - Capabilities
89
82
90
-
!!! Run First !!!
91
-
92
-
This script pulls the Capabilities from the Eureka platform and saves them in JSON format to be used later.
83
+
**Run First!** This script pulls the capabilities from the Eureka platform and saves them in JSON format to be used later.
93
84
94
85
## Pull Reference Data - OKAPI Permission Sets
95
86
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.
87
+
This script pulls the current permission sets from 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
88
98
89
---
99
90
## Data Formatting Functions
100
91
101
92
## Expanded Capability Sets
102
93
103
-
This scripts takes the Capability set data and expands out the linked capabilities.
94
+
This script takes the capability set data and expands the linked capabilities.
104
95
105
96
### Files generated:
106
-
107
-
-`FILE_EUREKA_CAPABILITY_SETS_EXPANDED`: JSON file listing all the capability sets and the capabilities assigned to that set
108
-
-`FILE_EUREKA_CAPABILITY_SETS_EXPANDED_CSV`: CSV file of the same data set.
109
-
-`FILE_EUREKA_CAPABILITY_SETS_EXPANDED_HTML`: HTML Table view that can be opened directly in the browser or saved to Confluence.
97
+
-`FILE_EUREKA_CAPABILITY_SETS_EXPANDED`: JSON file listing all the capability sets and the capabilities assigned to that set.
98
+
-`FILE_EUREKA_CAPABILITY_SETS_EXPANDED_CSV`: CSV file of the same data set.
99
+
-`FILE_EUREKA_CAPABILITY_SETS_EXPANDED_HTML`: HTML table view that can be opened directly in the browser or saved to Confluence.
110
100
111
101
## Compare OKAPI Permissions to Eureka Capabilities
112
102
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_
This script pulls the capability sets and uses the published names to match them to an OKAPI permission set. It expands on the included capabilities and permissions to show the names and UUIDs. Two files are generated:
122
104
123
-
**OKAPI sub permissions (if a Matching permission set is found)**: _okapiSubPermissions.name okapiSubPermissions.description okapiSubPermissions.permissionName_
105
+
-`FILE_COMPARED_SETS_TO_PERMISSIONS`: JSON file with all the collected data.
106
+
-`FILE_COMPARED_SETS_TO_PERMISSIONS_CSV`: CSV file that can be opened in Excel for easier viewing. The first row contains the headers. The data is formatted as:
-**OKAPI sub-permissions (if a matching permission set is found)**: _okapiSubPermissions.name, okapiSubPermissions.description, okapiSubPermissions.permissionName_
124
111
125
112
126
113
## Compare Current User Permission Sets to Eureka Capabilities
127
114
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.
129
-
This should allow a user to re-create a permission set using just capabilities.
115
+
This script takes current permission sets in the reference environment (visible and mutable) and 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. This should allow a user to recreate a permission set using just capabilities.
130
116
131
117
### Files generated:
132
-
133
-
-`FILE_COMPARED_CURRENT_TO_CAPABILITIES`: JSON version of the expanded data
134
-
-`FILE_COMPARED_CURRENT_TO_CAPABILITIES_CSV`: CSV version of the same data set
118
+
-`FILE_COMPARED_CURRENT_TO_CAPABILITIES`: JSON version of the expanded data.
119
+
-`FILE_COMPARED_CURRENT_TO_CAPABILITIES_CSV`: CSV version of the same data set.
135
120
136
121
---
137
122
## Create Working Documents
138
123
139
124
## Find Possible Capability Matches to OKAPI Permissions
125
+
This script will look at the JSON generated from `compareCurrentToCapabilities.py` and compare the assigned capability sets, ranking which set may best fit a new role that will match the permission set. It does this by looking at the capability sets' individual capabilities and then matching those to the ones in the permission set. The following data will be added:
140
126
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:
142
-
143
-
**Total** - Total number of capabilities in the set
144
-
145
-
**Matching** - Number of matching Capabilities to the permission set
127
+
-**Total**: Total number of capabilities in the set.
128
+
-**Matching**: Number of matching capabilities to the permission set.
129
+
-**Ranking**: Based on the percentage of total number of capabilities that match. Items with a rank of 0 or lower than X will be ignored.
146
130
147
-
**Ranking** - based on the percentage of total number of capabilities that match
148
-
149
-
Items with a rank of 0 or lower then X will be ignored.
150
-
151
-
### Files generated:
131
+
#### Files generated:
152
132
153
-
-`FILE_COMPARED_CURRENT_TO_CAPABILITIES`: JSON version of the expanded data
154
-
-`FILE_COMPARED_CURRENT_TO_CAPABILITIES_CSV`: CSV version of the same data set
133
+
-`FILE_COMPARED_CURRENT_TO_CAPABILITIES`: JSON version of the expanded data.
134
+
-`FILE_COMPARED_CURRENT_TO_CAPABILITIES_CSV`: CSV version of the same data set.
155
135
156
136
## 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.
137
+
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 user's browser.
159
138
160
139
### 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)
140
+
- Open the generated HTML in the browser of your choice (tested with Chrome).
141
+
- Select a permission set from the drop-down on the left-hand side of the screen (red arrow).
142
+
- Using the interface on the right side of the screen, start by selecting capability sets to fill in the majority of your missing capabilities for your permission set (blue arrow).
143
+
- Use the capabilities section to fill any smaller gaps (blue arrow).
166
144
167
145

168
146
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.
147
+
In this image, you can see that the permission set "Acq Unopen Reopen" has been selected. The three sections under the selection box are:
148
+
149
+
-**Missing Capabilities**: These are the capabilities that the scripts have identified as needed to recreate the permission set but are currently missing. In this example, since no capability sets or capabilities are selected, all sub-capabilities are displayed.
150
+
-**Extra Capabilities**: These are capabilities that were added by selecting either capability sets or capabilities on the left.
151
+
-**Assigned Capabilities**: These are the currently assigned capabilities based on what has been selected on the left.
173
152
174
153

175
154
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.
155
+
This image depicts what happens after a user has selected a capability set on the left. The three areas are adjusted to show the most current information.
177
156
178
157

179
158
@@ -182,16 +161,12 @@ This image depicts what happens after a user has selected a Capability Set on th
182
161
183
162
# Contributing
184
163
185
-
Pull requests are welcome. For major changes, please open an issue first
186
-
to discuss what you would like to change.
187
-
188
-
Please also fork as needed.
164
+
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please also fork as needed.
189
165
190
166
# .env File
191
167
192
168
## 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.
169
+
These environment 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
170
196
171
`OKAPI_URL` =
197
172
@@ -202,8 +177,7 @@ These env variables are for your OKAPI reference environment. I suggest using bu
202
177
`OKAPI_PASSWORD` =
203
178
204
179
## 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.
180
+
These environment 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
181
208
182
`EUREKA_URL` =
209
183
@@ -215,7 +189,7 @@ These env variables are for your Eureka reference environment. I suggest using s
215
189
216
190
## Reference OKAPI Env
217
191
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.
192
+
These environment variables are for your production or test environment. The user account will need permissions to read permission data. This connection is used to pull your current permission sets.
0 commit comments