X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fuser.php;h=c265bf0ce27a0a1ebc7e30c4b7048578670dfe0d;hb=c76545c351fae4e2298624ff9ee5bf854dc5a5b6;hp=5944a7f8be0aa8b8f858e029776e5359839cb2cb;hpb=c79e28fc7ce2b8a68da060790f96dcc133d5b246;p=platal.git diff --git a/classes/user.php b/classes/user.php index 5944a7f..c265bf0 100644 --- a/classes/user.php +++ b/classes/user.php @@ -21,6 +21,15 @@ class User extends PlUser { + const PERM_GROUPS = 'groups'; + const PERM_MAIL = 'mail'; + const PERM_DIRECTORY_AX = 'directory_ax'; + const PERM_DIRECTORY_PRIVATE = 'directory_private'; + const PERM_EDIT_DIRECTORY = 'edit_directory'; + const PERM_FORUMS = 'forums'; + const PERM_LISTS = 'lists'; + const PERM_PAYMENT = 'payment'; + private $_profile_fetched = false; private $_profile = null; @@ -322,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 = {?}',