Skip to content

Commit 178dd80

Browse files
committed
Remove all references to editor role
1 parent 0f3de25 commit 178dd80

File tree

6 files changed

+7
-17
lines changed

6 files changed

+7
-17
lines changed

src/client/src/pages/UserManagement/Components/Dialog/NewUserDialog.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export default function NewUserDialog(props) {
103103
{...register("role")}
104104
margin="dense"
105105
id="role-input"
106-
label="Role - user/editor/admin"
106+
label="Role - user/admin"
107107
onBlur={() => trigger("role")}
108108
variant="standard"
109109
fullWidth

src/client/src/pages/UserManagement/Components/Dialog/UpdateUserDialog.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export default function UpdateUserDialog(props) {
109109
defaultValue={role}
110110
margin="dense"
111111
id="role-input"
112-
label="Role - user/editor/admin"
112+
label="Role - user/admin"
113113
onBlur={() => trigger("role")}
114114
variant="standard"
115115
fullWidth

src/client/src/pages/UserManagement/Validations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const buildUsernameValidation = () => {
3030
export const buildRoleValidation = () => {
3131
return Yup.string()
3232
.trim()
33-
.oneOf(["user", "editor", "admin"], "Role must be one of the following: user/editor/admin")
33+
.oneOf(["user", "admin"], "Role must be one of the following: user/admin")
3434
.required("Role is required")
3535
}
3636

src/server/api/user_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def user_create():
266266
username : str
267267
full_name : str
268268
password : str
269-
role : str, one of `user`, `editor`, `admin`
269+
role : str, one of `user`, `admin`
270270
271271
Returns
272272
----------

src/server/db_setup/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Form POST Parameters
1111
username : str
1212
full_name : str
1313
password : str
14-
role : str, one of `user`, `editor`, `admin`
14+
role : str, one of `user`, `admin`
1515

1616
Returns
1717
----------
@@ -28,6 +28,5 @@ Returns
2828
One header row of field names, one row per user
2929
"['username', 'full_name', 'active', 'role'],
3030
['admin', None, 'Y', 'admin'],
31-
['editor', None, 'Y', 'editor'],
3231
['steve11', 'Steve the User', 'Y', 'admin'],
3332
['user', None, 'Y', 'user'],"

src/server/db_setup/base_users.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@
88

99

1010
try:
11-
from secrets_dict import BASEUSER_PW, BASEEDITOR_PW, BASEADMIN_PW
11+
from secrets_dict import BASEUSER_PW, BASEADMIN_PW
1212
except ImportError:
1313
# Not running locally
1414
logger.debug("Couldn't get BASE user PWs from file, trying environment **********")
1515
from os import environ
1616

1717
try:
1818
BASEUSER_PW = environ['BASEUSER_PW']
19-
BASEEDITOR_PW = environ['BASEEDITOR_PW']
2019
BASEADMIN_PW = environ['BASEADMIN_PW']
2120

2221
except KeyError:
@@ -39,15 +38,14 @@ def create_base_roles():
3938
role_count = len(result.fetchall())
4039
if role_count == 0:
4140
connection.execute("INSERT into pdp_user_roles values (1, 'user') ")
42-
connection.execute("INSERT into pdp_user_roles values (2, 'editor') ")
4341
connection.execute("INSERT into pdp_user_roles values (9, 'admin') ")
4442

4543
else:
4644
logger.debug("%d roles already present in DB, not creating", role_count)
4745

4846

4947
def create_base_users(): # TODO: Just call create_user for each
50-
""" Creates three users (user, editor, admin) for testing
48+
""" Creates two users (user, admin) for testing
5149
Password for each is user name with 'pw' appended """
5250
with engine.connect() as connection:
5351

@@ -73,13 +71,6 @@ def create_base_users(): # TODO: Just call create_user for each
7371
)
7472
connection.execute(ins_stmt)
7573

76-
# editor
77-
pw_hash = user_api.hash_password(BASEEDITOR_PW)
78-
ins_stmt = pu.insert().values(
79-
username="base_editor", full_name="Base Editor", password=pw_hash, active="Y", role=2,
80-
)
81-
connection.execute(ins_stmt)
82-
8374
# admin
8475
pw_hash = user_api.hash_password(BASEADMIN_PW)
8576
ins_stmt = pu.insert().values(

0 commit comments

Comments
 (0)