User::canEdit takes user permissions into account.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 17 Sep 2010 14:38:59 +0000 (16:38 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 17 Sep 2010 14:38:59 +0000 (16:38 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
classes/user.php

index 8551cbd..c265bf0 100644 (file)
@@ -331,8 +331,9 @@ class User extends PlUser
      */
     public function canEdit(Profile $profile)
     {
-        // XXX: Check permissions (e.g. secretary permission)
-        //      and flags from the profile
+        if ($this->checkPerms(User::PERM_EDIT_DIRECTORY)) {
+            return true;
+        }
         return XDB::fetchOneCell('SELECT  pid
                                     FROM  account_profiles
                                    WHERE  uid = {?} AND pid = {?}',