diff --git a/module/blog/blog.php b/module/blog/blog.php index 8d286c06..5370b88f 100644 --- a/module/blog/blog.php +++ b/module/blog/blog.php @@ -16,6 +16,7 @@ class blog extends common { const EDIT_OWNER = 'owner'; const EDIT_GROUP = 'group'; + const EDIT_ALL = 'all'; public static $actions = [ 'add' => self::GROUP_EDITOR, @@ -77,12 +78,12 @@ class blog extends common { // Permissions d'un article public static $articleConsent = [ + self::EDIT_ALL => 'Tous les groupes', self::EDIT_GROUP => 'Groupe du propriƩtaire', self::EDIT_OWNER => 'PropiƩtaire' ]; - public static $users = []; const BLOG_VERSION = '3.05.dev'; @@ -312,11 +313,15 @@ class blog extends common { AND $this->getUser('group') >= self::GROUP_EDITOR ) - ) OR ( + OR ( // Groupe - $this->getData(['module', $this->getUrl(0), $this->getUrl(1),'editConsent']) !== self::EDIT_OWNER + $this->getData(['module', $this->getUrl(0), $value,'editConsent'])) !== self::EDIT_OWNER AND $this->getUser('group') >= $this->getData(['module',$this->getUrl(0), $value,'editConsent']) - ) + ) + OR ( + // Tout le monde + $this->getData(['module', $this->getUrl(0), $value,'editConsent']) === self::EDIT_ALL + ) ) { $filterData[] = $value; } @@ -689,3 +694,4 @@ class blog extends common { } } } + diff --git a/module/blog/view/article/article.php b/module/blog/view/article/article.php index 6c966a4c..b8592fbc 100644 --- a/module/blog/view/article/article.php +++ b/module/blog/view/article/article.php @@ -22,6 +22,10 @@ $this->getData(['module', $this->getUrl(0), $this->getUrl(1),'editConsent']) !== $module::EDIT_OWNER AND $this->getUser('group') >= $this->getData(['module',$this->getUrl(0), $this->getUrl(1),'editConsent']) ) + OR ( + // Tout le monde + $this->getData(['module', $this->getUrl(0), $this->getUrl(1),'editConsent']) === $module::EDIT_ALL + ) ): ?> helper::baseUrl() . $this->getUrl(0) . '/edit/' . $this->getUrl(1) . '/' . $_SESSION['csrf'],