aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
authorTristan Darricau <tristan.darricau@sensiolabs.com>2015-07-22 11:30:50 +0200
committerTristan Darricau <tristan.darricau@sensiolabs.com>2015-07-22 11:30:50 +0200
commite1cbe735380d98f2b87f4243317fd55cbc0439af (patch)
treef7047bc58b88f666051ee4eafe001ce898763672 /phpBB/phpbb
parent8bfbd7782815aeee6ada6fa8a495b780fc21cb3d (diff)
parent7d31232846e29311e5b76bf32f41f64da7985a79 (diff)
downloadforums-e1cbe735380d98f2b87f4243317fd55cbc0439af.tar
forums-e1cbe735380d98f2b87f4243317fd55cbc0439af.tar.gz
forums-e1cbe735380d98f2b87f4243317fd55cbc0439af.tar.bz2
forums-e1cbe735380d98f2b87f4243317fd55cbc0439af.tar.xz
forums-e1cbe735380d98f2b87f4243317fd55cbc0439af.zip
Merge pull request #3781 from Elsensee/ticket/8708-2
[ticket/8708] Add extra permission for posting global announcements * Elsensee/ticket/8708-2: [ticket/8708] Apply permission 'f_announce_global' [ticket/8708] Add f_announce_global permission
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/db/migration/data/v320/announce_global_permission.php41
-rw-r--r--phpBB/phpbb/permissions.php1
2 files changed, 42 insertions, 0 deletions
diff --git a/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php b/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php
new file mode 100644
index 0000000000..fe30a1c1b8
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php
@@ -0,0 +1,41 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v320;
+
+class announce_global_permission extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ $sql = 'SELECT auth_option_id
+ FROM ' . ACL_OPTIONS_TABLE . "
+ WHERE auth_option = 'f_announce_global'";
+ $result = $this->db->sql_query($sql);
+ $auth_option_id = $this->db->sql_fetchfield('auth_option_id');
+ $this->db->sql_freeresult($result);
+
+ return $auth_option_id !== false;
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\rc2');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('permission.add', array('f_announce_global', false, 'f_announce')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/permissions.php b/phpBB/phpbb/permissions.php
index 82f59b5c20..c462f72a73 100644
--- a/phpBB/phpbb/permissions.php
+++ b/phpBB/phpbb/permissions.php
@@ -251,6 +251,7 @@ class permissions
'f_post' => array('lang' => 'ACL_F_POST', 'cat' => 'post'),
'f_sticky' => array('lang' => 'ACL_F_STICKY', 'cat' => 'post'),
'f_announce' => array('lang' => 'ACL_F_ANNOUNCE', 'cat' => 'post'),
+ 'f_announce_global' => array('lang' => 'ACL_F_ANNOUNCE_GLOBAL', 'cat' => 'post'),
'f_reply' => array('lang' => 'ACL_F_REPLY', 'cat' => 'post'),
'f_edit' => array('lang' => 'ACL_F_EDIT', 'cat' => 'post'),
'f_delete' => array('lang' => 'ACL_F_DELETE', 'cat' => 'post'),