forked from ZwiiCMS-Team/ZwiiCMS
permissions sur modules externes
This commit is contained in:
parent
32e727eb71
commit
f9569b1085
|
@ -27,7 +27,7 @@ class blog extends common {
|
|||
'commentDelete' => self::GROUP_MODERATOR,
|
||||
'commentDeleteAll' => self::GROUP_MODERATOR,
|
||||
'config' => self::GROUP_EDITOR,
|
||||
'delete' => self::GROUP_EDITOR,
|
||||
'delete' => self::GROUP_MODERATOR,
|
||||
'edit' => self::GROUP_EDITOR,
|
||||
'index' => self::GROUP_VISITOR
|
||||
];
|
||||
|
@ -375,6 +375,13 @@ class blog extends common {
|
|||
* Suppression
|
||||
*/
|
||||
public function delete() {
|
||||
// Contrôle d'accès
|
||||
if ( self::$actions[__FUNCTION__] >= $this->getUser('group')) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
if($this->getData(['module', $this->getUrl(0), $this->getUrl(2)]) === null) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
|
@ -400,6 +407,7 @@ class blog extends common {
|
|||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Édition
|
||||
|
|
|
@ -37,7 +37,7 @@ class gallery extends common {
|
|||
|
||||
public static $actions = [
|
||||
'config' => self::GROUP_EDITOR,
|
||||
'delete' => self::GROUP_EDITOR,
|
||||
'delete' => self::GROUP_MODERATOR,
|
||||
'dirs' => self::GROUP_EDITOR,
|
||||
'sortGalleries' => self::GROUP_EDITOR,
|
||||
'sortPictures' => self::GROUP_EDITOR,
|
||||
|
@ -287,6 +287,13 @@ class gallery extends common {
|
|||
* Suppression
|
||||
*/
|
||||
public function delete() {
|
||||
// Contrôle d'accès
|
||||
if ( self::$actions[__FUNCTION__] >= $this->getUser('group')) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// $url prend l'adresse sans le token
|
||||
// La galerie n'existe pas
|
||||
if($this->getData(['module', $this->getUrl(0), $this->getUrl(2)]) === null) {
|
||||
|
@ -314,6 +321,7 @@ class gallery extends common {
|
|||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Liste des dossiers
|
||||
|
|
|
@ -17,7 +17,7 @@ class news extends common {
|
|||
public static $actions = [
|
||||
'add' => self::GROUP_EDITOR,
|
||||
'config' => self::GROUP_EDITOR,
|
||||
'delete' => self::GROUP_EDITOR,
|
||||
'delete' => self::GROUP_MODERATOR,
|
||||
'edit' => self::GROUP_EDITOR,
|
||||
'index' => self::GROUP_VISITOR
|
||||
];
|
||||
|
@ -117,6 +117,13 @@ class news extends common {
|
|||
* Suppression
|
||||
*/
|
||||
public function delete() {
|
||||
// Contrôle d'accès
|
||||
if ( self::$actions[__FUNCTION__] >= $this->getUser('group')) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
// La news n'existe pas
|
||||
if($this->getData(['module', $this->getUrl(0), $this->getUrl(2)]) === null) {
|
||||
// Valeurs en sortie
|
||||
|
@ -143,6 +150,7 @@ class news extends common {
|
|||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Édition
|
||||
|
|
Loading…
Reference in New Issue