aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/1.191_add_dedicated_admins_role.php
blob: 9a0c5eec1d9b1d057fe35dd04032b103191ef822 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php

class AddDedicatedAdminsRole extends Migration
{

    public function description()
    {
        return 'Non-admins may now be dedicated admins, which means they can see the admin-area with restricted rights.';
    }

    public function up()
    {
        DBManager::get()->exec("
            INSERT INTO `roles` (`rolename`, `system`)
            VALUES ('DedicatedAdmin', 'n');
        ");
        RolePersistence::expireRolesCache();
    }

    public function down()
    {
        DBManager::get()->execute("
            DELETE FROM `roles` WHERE `rolename` = 'DedicatedAdmin' AND `system` = 'n'
        ");
        RolePersistence::expireRolesCache();
    }

}