mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-09 17:00:27 +00:00
parent
ac59af19dd
commit
d7eb39c88e
@ -38,15 +38,14 @@ POST /admin/delete-role
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete the role
|
|
||||||
sqlTiddlerDatabase.deleteRole(role_id);
|
|
||||||
|
|
||||||
// Check if the role is in use
|
// Check if the role is in use
|
||||||
var isRoleInUse = sqlTiddlerDatabase.isRoleInUse(role_id);
|
var isRoleInUse = sqlTiddlerDatabase.isRoleInUse(role_id);
|
||||||
if(isRoleInUse) {
|
if(isRoleInUse) {
|
||||||
sqlTiddlerDatabase.deleteUserRolesByRoleId(role_id);
|
sqlTiddlerDatabase.deleteUserRolesByRoleId(role_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete the role
|
||||||
|
sqlTiddlerDatabase.deleteRole(role_id);
|
||||||
// Redirect back to the roles management page
|
// Redirect back to the roles management page
|
||||||
response.writeHead(302, { "Location": "/admin/roles" });
|
response.writeHead(302, { "Location": "/admin/roles" });
|
||||||
response.end();
|
response.end();
|
||||||
|
@ -1156,7 +1156,7 @@ SqlTiddlerDatabase.prototype.deleteRole = function(roleId) {
|
|||||||
|
|
||||||
SqlTiddlerDatabase.prototype.listRoles = function() {
|
SqlTiddlerDatabase.prototype.listRoles = function() {
|
||||||
return this.engine.runStatementGetAll(`
|
return this.engine.runStatementGetAll(`
|
||||||
SELECT * FROM roles ORDER BY role_name
|
SELECT * FROM roles ORDER BY role_name DESC
|
||||||
`);
|
`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user