From 00cbcc60aa1c2892c79636b5905923305b610b56 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sat, 4 Nov 2023 11:21:36 +0100 Subject: [PATCH] fix permissions --- CHANGELOG.md | 6 ++++++ README.md | 8 ++++---- _define.php | 2 +- dcstore.xml | 4 ++-- src/My.php | 7 +++++-- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e46aae..b2cc7af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +dcAdvancedCleaner 1.6.1 - 2023.11.04 +=========================================================== +* Require Dotclear 2.28 +* Require PHP 8.1 +* Cosmetic fix + dcAdvancedCleaner 1.6 - 2023.10.18 =========================================================== * Require Dotclear 2.28 diff --git a/README.md b/README.md index 7025e71..6026a69 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # README -[![Release](https://img.shields.io/badge/release-1.6-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/dcAdvancedCleaner/releases) -![Date](https://img.shields.io/badge/date-2023.10.18-c44d58.svg) +[![Release](https://img.shields.io/badge/release-1.6.1-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/dcAdvancedCleaner/releases) +![Date](https://img.shields.io/badge/date-2023.11.04-c44d58.svg) [![Dotclear](https://img.shields.io/badge/dotclear-v2.28-137bbb.svg)](https://fr.dotclear.org/download) [![Dotaddict](https://img.shields.io/badge/dotaddict-official-9ac123.svg)](https://plugins.dotaddict.org/dc2/details/dcAdvancedCleaner) [![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/JcDenis/dcAdvancedCleaner/src/branch/master/LICENSE) @@ -16,8 +16,8 @@ _dcAdvancedCleaner_ is a plugin for the open-source web publishing software call * Dotclear 2.28 * PHP 8.1+ -* Plugin Uninstaller -* Permissions superadmin +* Plugin Uninstaller (from distribution) +* Dotclaer superadmin permission ## USAGE diff --git a/_define.php b/_define.php index 9ae99cc..646b6a7 100644 --- a/_define.php +++ b/_define.php @@ -18,7 +18,7 @@ $this->registerModule( 'Advanced cleaner', 'Make a huge cleaning of dotclear', 'Jean-Christian Denis and Contributors', - '1.6', + '1.6.1', [ 'requires' => [ ['core', '2.28'], diff --git a/dcstore.xml b/dcstore.xml index a34a0b3..39ee950 100644 --- a/dcstore.xml +++ b/dcstore.xml @@ -2,10 +2,10 @@ Advanced cleaner - 1.6 + 1.6.1 Jean-Christian Denis and Contributors Make a huge cleaning of dotclear - https://git.dotclear.watch/JcDenis/dcAdvancedCleaner/releases/download/v1.6/plugin-dcAdvancedCleaner.zip + https://git.dotclear.watch/JcDenis/dcAdvancedCleaner/releases/download/v1.6.1/plugin-dcAdvancedCleaner.zip 2.28 https://git.dotclear.watch/JcDenis/dcAdvancedCleaner/src/branch/master/README.md https://git.dotclear.watch/JcDenis/dcAdvancedCleaner/issues diff --git a/src/My.php b/src/My.php index 6aef987..7da3d68 100644 --- a/src/My.php +++ b/src/My.php @@ -18,7 +18,10 @@ class My extends MyPlugin { public static function checkCustomContext(int $context): ?bool { - // Limit to backend and super admin - return App::task()->checkContext('BACKEND') && App::auth()->isSuperAdmin(); + return match ($context) { + // Limit to super admin + self::MODULE => App::auth()->isSuperAdmin(), + default => null, + }; } }