Skip to content

Commit

Permalink
Fixed validation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jzongker committed Aug 3, 2023
1 parent 8494a76 commit 90ecabb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/appBase
2 changes: 1 addition & 1 deletion src/people/components/Household.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const Household: React.FC<Props> = (props) => {
ApiHelper.get("/people/household/" + household.id, "MembershipApi").then(data => setMembers(data));
}
}
const getEditFunction = () => (UserHelper.checkAccess(Permissions.membershipApi.households.edit)) ? handleEdit : undefined
const getEditFunction = () => (UserHelper.checkAccess(Permissions.membershipApi.people.edit)) ? handleEdit : undefined
React.useEffect(loadData, [props.person]);
React.useEffect(() => {
setPhoto(PersonHelper.getPhotoUrl(props.person))
Expand Down
2 changes: 1 addition & 1 deletion src/settings/components/RoleMembers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const RoleMembers: React.FC<Props> = (props) => {
}

const getRows = () => {
let canEdit = UserHelper.checkAccess(Permissions.membershipApi.roleMembers.edit);
let canEdit = UserHelper.checkAccess(Permissions.membershipApi.roles.edit);
let rows: JSX.Element[] = [];
if (isRoleEveryone) {
rows.push(<TableRow><TableCell key="0">This role applies to all the members of the church.</TableCell></TableRow>)
Expand Down
11 changes: 3 additions & 8 deletions src/settings/components/Roles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export const Roles: React.FC<Props> = ({ selectRoleId, selectedRoleId, church })
{ name: "Church Staff", description: "Can edit most data in Chums.org, including people, groups, attendance and forms.", permissions: [
Permissions.membershipApi.people.view,
Permissions.membershipApi.people.edit,
Permissions.membershipApi.households.edit,
Permissions.membershipApi.groups.edit,
Permissions.membershipApi.groupMembers.view,
Permissions.membershipApi.groupMembers.edit,
Expand All @@ -44,15 +43,11 @@ export const Roles: React.FC<Props> = ({ selectRoleId, selectedRoleId, church })
Permissions.attendanceApi.attendance.edit,
Permissions.attendanceApi.attendance.view,
Permissions.attendanceApi.services.edit,
Permissions.attendanceApi.settings.edit,
]},
{ name: "Content Admin", description: "Can edit website content, mobile content and sermons.", permissions: [
Permissions.contentApi.chat.host,
Permissions.contentApi.content.edit,
Permissions.contentApi.links.edit,
Permissions.contentApi.pages.edit,
Permissions.contentApi.settings.edit,
Permissions.contentApi.streamingServices.edit,
Permissions.contentApi.streamingServices.edit
]},
{ name: "Lessons Admin", description: "Can set up classrooms and schedule lessons on Lessons.church.", permissions: [
{ api: "LessonsApi", contentType:"Schedules", permission: "Edit" }
Expand Down Expand Up @@ -110,11 +105,11 @@ export const Roles: React.FC<Props> = ({ selectRoleId, selectedRoleId, church })
const sortedRoles = [...roles].sort((a, b) => a.name > b.name ? 1 : -1);
const canEdit = (
UserHelper.checkAccess(Permissions.membershipApi.roles.edit)
&& UserHelper.checkAccess(Permissions.membershipApi.users.edit)
&& UserHelper.checkAccess(Permissions.membershipApi.roles.edit)
&& UserHelper.checkAccess(Permissions.membershipApi.people.view)
);

if (UserHelper.checkAccess(Permissions.membershipApi.rolePermissions.edit)) {
if (UserHelper.checkAccess(Permissions.membershipApi.roles.edit)) {
result.push(
<TableRow key="everyone">
<TableCell><i className="groups" /> <Link to={`/settings/role/everyone`}>(Everyone)</Link></TableCell>
Expand Down

0 comments on commit 90ecabb

Please sign in to comment.