mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-08 16:30:26 +00:00
parent
ac59af19dd
commit
d7eb39c88e
@ -38,15 +38,14 @@ POST /admin/delete-role
|
||||
return;
|
||||
}
|
||||
|
||||
// Delete the role
|
||||
sqlTiddlerDatabase.deleteRole(role_id);
|
||||
|
||||
// Check if the role is in use
|
||||
var isRoleInUse = sqlTiddlerDatabase.isRoleInUse(role_id);
|
||||
if(isRoleInUse) {
|
||||
sqlTiddlerDatabase.deleteUserRolesByRoleId(role_id);
|
||||
}
|
||||
|
||||
// Delete the role
|
||||
sqlTiddlerDatabase.deleteRole(role_id);
|
||||
// Redirect back to the roles management page
|
||||
response.writeHead(302, { "Location": "/admin/roles" });
|
||||
response.end();
|
||||
|
@ -1156,7 +1156,7 @@ SqlTiddlerDatabase.prototype.deleteRole = function(roleId) {
|
||||
|
||||
SqlTiddlerDatabase.prototype.listRoles = function() {
|
||||
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