Fixes erroneous rights for address and job deletion.
authorStéphane Jacob <sj@m4x.org>
Sun, 13 Feb 2011 22:13:43 +0000 (23:13 +0100)
committerStéphane Jacob <sj@m4x.org>
Sun, 13 Feb 2011 22:13:43 +0000 (23:13 +0100)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
classes/address.php
modules/profile/jobs.inc.php

index 8d1fa48..ba09823 100644 (file)
@@ -586,7 +586,7 @@ class Address
         $this->text = trim($this->text);
         $this->phones = Phone::formatFormArray($this->phones, $this->error, new ProfileVisibility($this->pub));
         if ($this->removed == 1) {
-            if (S::user()->checkPerms('directory_ax') && Phone::hasPrivate($this->phones)) {
+            if (!S::user()->checkPerms('directory_private') && Phone::hasPrivate($this->phones)) {
                 Platal::page()->trigWarning("L'adresse ne peut être supprimée car elle contient des informations pour lesquelles vous n'avez le droit d'édition.");
             } else  {
                 $this->text = '';
index 3f3097b..893145e 100644 (file)
@@ -224,7 +224,7 @@ class ProfileSettingJob implements ProfileSetting
             }
 
             if (isset($job['removed']) && $job['removed']) {
-                if (S::user()->checkPerms('directory_ax')
+                if (!S::user()->checkPerms('directory_private')
                     && (Phone::hasPrivate($job['w_phone']) || Address::hasPrivate($job['w_address']) || $job['w_email_pub'] == 'private')) {
                     Platal::page()->trigWarning("L'entreprise ne peut être supprimée car elle contient des informations pour lesquelles vous n'avez le droit d'édition.");
                 } else {