Skip to content

Commit

Permalink
Merge pull request #14 from H2CK/update_2_0_3
Browse files Browse the repository at this point in the history
Update to Webtrees 2.0.3
  • Loading branch information
H2CK committed Mar 18, 2020
2 parents 128a839 + 76cdfaa commit 3bb7c82
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ language: shell
env:
global:
- QEMU_VERSION=v4.2.0-2
- WT_VERSION=2.0.2
- WT_VERSION=2.0.3
- DOCKER_FILE=Dockerfile.travis

jobs:
Expand Down
52 changes: 51 additions & 1 deletion Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,31 @@ public static function checkFamilyAccess(Family $family = null, bool $edit = fal

return $family;
}

/**
* @param Header|null $header
* @param bool $edit
*
* @return Header
* @throws RecordNotFoundException
* @throws RecordAccessDeniedException
*/
public static function checkHeaderAccess(?Header $header, bool $edit = false): Header
{
if ($header === null) {
throw new RecordNotFoundException();
}

if ($edit && $header->canEdit()) {
return $header;
}

if ($header->canShow()) {
return $header;
}

throw new RecordAccessDeniedException();
}

/**
* @param Individual|null $individual
Expand Down Expand Up @@ -436,4 +461,29 @@ public static function checkSubmitterAccess(Submitter $submitter = null, bool $e

return $submitter;
}
}

/*
* @param Submission|null $submission
* @param bool $edit
*
* @return Submission
* @throws RecordNotFoundException
* @throws RecordAccessDeniedException
*/
public static function checkSubmissionAccess(?Submission $submission, bool $edit = false): Submission
{
if ($submission === null) {
throw new RecordNotFoundException();
}

if ($edit && $submission->canEdit()) {
return $submission;
}

if ($submission->canShow()) {
return $submission;
}

throw new RecordAccessDeniedException();
}
}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ENV DEBIAN_FRONTEND="noninteractive" HOME="/root" LC_ALL="C.UTF-8" LANG="en_US.U
ENV supervisor_conf /etc/supervisor/supervisord.conf
ENV security_conf /etc/apache2/conf-available/security.conf
ENV start_scripts_path /bin
ENV WT_VERSION="2.0.2"
ENV WT_VERSION="2.0.3"

# Update packages from baseimage
RUN apt-get update -qq
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.travis
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG ARCH=amd64

FROM ${ARCH}/ubuntu:bionic

ARG WT_VERSION=2.0.2
ARG WT_VERSION=2.0.3
ARG QEMU_ARCH

# Set correct environment variables
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,4 @@ This image contains now the necessary libraries to optionally also select Postgr
* **2020/01/16:** Webtrees 2.0.1 - Added multi arch support
* **2020/02/01:** Webtrees 2.0.2
* **2020/03/06:** Webtrees 2.0.2 - Added support to automatically initialize db and webtrees. Provided K8S template for example deployment.
* **2020/03/18:** Webtrees 2.0.3 - Update to Webtrees 2.0.3

0 comments on commit 3bb7c82

Please sign in to comment.