Release v2.17.1: remove obsolete dashboard permission
This commit is contained in:
1 parent
3ce4f70601
commit
6ce70ad7cb
7 files changed
+54
-6
No files matched your search
@@ -161,7 +161,7 @@ test('2.17.0 migration adds the expiring view-as session columns', async () => {
|
||||
]);
|
||||
|
||||
const pending = await getPendingMigrations(pool, { currentVersion: '2.16.2' });
|
||||
assert.deepEqual(pending.map(function (migration) { return migration.version; }), ['2.17.0']);
|
||||
assert.deepEqual(pending.map(function (migration) { return migration.version; }), ['2.17.0', '2.17.1']);
|
||||
await pending[0].run(pool);
|
||||
|
||||
assert.ok(pool.queries.some(function ([sql]) {
|
||||
@@ -170,4 +170,32 @@ test('2.17.0 migration adds the expiring view-as session columns', async () => {
|
||||
assert.ok(pool.queries.some(function ([sql]) {
|
||||
return String(sql).includes('ALTER TABLE a_sessions ADD COLUMN view_as_expires_at DATETIME NULL AFTER view_as_user_id');
|
||||
}));
|
||||
});
|
||||
|
||||
test('2.17.1 migration removes obsolete dashboard.allow grants and permission', async () => {
|
||||
const pool = createPool([
|
||||
{
|
||||
match(sql) {
|
||||
return sql.includes('FROM information_schema.COLUMNS');
|
||||
},
|
||||
result: [[{ column_count: 1 }]]
|
||||
},
|
||||
{
|
||||
match(sql) {
|
||||
return sql.includes('FROM information_schema.TABLES');
|
||||
},
|
||||
result: [[{ table_count: 0 }]]
|
||||
}
|
||||
]);
|
||||
|
||||
const pending = await getPendingMigrations(pool, { currentVersion: '2.17.0' });
|
||||
assert.deepEqual(pending.map(function (migration) { return migration.version; }), ['2.17.1']);
|
||||
await pending[0].run(pool);
|
||||
|
||||
assert.ok(pool.queries.some(function ([sql, params]) {
|
||||
return String(sql).includes('DELETE role_permissions') && params[0] === 'dashboard.allow';
|
||||
}));
|
||||
assert.ok(pool.queries.some(function ([sql, params]) {
|
||||
return String(sql).includes('DELETE FROM a_permissions') && params[0] === 'dashboard.allow';
|
||||
}));
|
||||
});
|
||||
Reference in new issue
Block a user