Skip to content

Commit

Permalink
Merge branch 'hotfix/1.6.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
abrain committed May 29, 2019
2 parents fac6da2 + 5f93639 commit e4f2d20
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
class Core
{
const VERSION = '1.6.0';
const VERSION = '1.6.1';
const DB_VERSION = 40;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Types/Unit.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function getRegistrationArgs()
return array(
'labels' => $this->getLabels(),
'public' => false,
'supports' => array('title', 'editor', 'thumbnail', 'revisions', 'custom-fields'),
'supports' => array('title', 'editor', 'thumbnail', 'revisions', 'custom-fields', 'author'),
'show_ui' => true,
'show_in_menu' => 'edit.php?post_type=' . Report::SLUG,
'show_in_admin_bar' => false,
Expand Down
16 changes: 15 additions & 1 deletion src/UserRightsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ class UserRightsManager
'delete_others_einsatzberichte'
);

private $capabilitiesUnit = array(
'edit_evw_units',
'edit_private_evw_units',
'edit_published_evw_units',
'edit_others_evw_units',
'publish_evw_units',
'read_private_evw_units',
'delete_evw_units',
'delete_private_evw_units',
'delete_published_evw_units',
'delete_others_evw_units'
);

/**
* @param $roleSlug
*
Expand All @@ -48,7 +61,8 @@ public function isRoleAllowedToEdit($roleSlug)
*/
public function userHasCap($allcaps, $caps, $args, $user)
{
$requestedCaps = array_intersect(self::$capabilities, $caps);
$allCapabilities = array_merge(self::$capabilities, $this->capabilitiesUnit);
$requestedCaps = array_intersect($allCapabilities, $caps);

// Wenn es nicht um Berechtigungen aus der Einsatzverwaltung geht, können wir uns den Rest sparen
if (count($requestedCaps) == 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/einsatzverwaltung.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Einsatzverwaltung
Plugin URI: https://einsatzverwaltung.abrain.de
Description: Verwaltung und Darstellung von Einsatzberichten der Feuerwehr und anderer Hilfsorganisationen
Version: 1.6.0
Version: 1.6.1
Author: Andreas Brain
Author URI: https://www.abrain.de
License: GPLv2
Expand Down
7 changes: 4 additions & 3 deletions src/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: Feuerwehr, Hilfsorganisation, Öffentlichkeitsarbeit
Requires at least: 4.7.0
Tested up to: 5.2
Requires PHP: 5.3.0
Stable tag: 1.6.0
Stable tag: 1.6.1
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -55,6 +55,9 @@ Nein, mehr gibt es [hier](https://einsatzverwaltung.abrain.de/faq/).

== Changelog ==

= 1.6.1 =
* Fixed user privileges for editing units

= 1.6.0 =
* Added support for multiple units
* Added a shortcode to display the number of reports
Expand Down Expand Up @@ -84,8 +87,6 @@ Nein, mehr gibt es [hier](https://einsatzverwaltung.abrain.de/faq/).

== Upgrade Notice ==

= 1.6.0 =
Support for multiple units, report count shortcode and more

== Social Media ==

Expand Down

0 comments on commit e4f2d20

Please sign in to comment.