We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Working example
namespace phpbbstudio\mnote\migrations; class install_permissions extends \phpbb\db\migration\migration { public function effectively_installed() { $sql = 'SELECT * FROM ' . $this->table_prefix . "acl_options WHERE auth_option = '" . $this->db->sql_escape('a_phpbbstudio_mnote') . "'"; $result = $this->db->sql_query_limit($sql, 1); $row = $this->db->sql_fetchrow($result); $this->db->sql_freeresult($result); return $row !== false; } public static function depends_on() { return ['\phpbb\db\migration\data\v33x\v334']; } public function update_data() { return [ // Add permissions not set ['permission.add', ['a_phpbbstudio_mnote']], ['permission.add', ['m_phpbbstudio_mnote']], // Set permission on role if it exists ['if', [ ['permission.role_exists', ['ROLE_ADMIN_FULL']], ['permission.permission_set', ['ROLE_ADMIN_FULL', 'a_phpbbstudio_mnote']], ]], ['if', [ ['permission.role_exists', ['ROLE_MOD_FULL']], ['permission.permission_set', ['ROLE_MOD_FULL', 'm_phpbbstudio_mnote']], ]], ]; } }
The text was updated successfully, but these errors were encountered:
The effectively_installed() method here uses its own query instead of the native tool, just do not care, it works. 😉
effectively_installed()
Sorry, something went wrong.
I was like, when did we get that? 🧐
Oh. I added it. Like a year ago. 🤪
Yes, you did it. 😜
Successfully merging a pull request may close this issue.
Working example
The text was updated successfully, but these errors were encountered: