Rename default Admin role to Cluster Admin

Clarify the purpose and distinquesh the Admin role a bit better from the
in-game admin status by renaming the role to Cluster Admin.
This commit is contained in:
Hornwitser committed 2020-11-09 15:57:46 +01:00
1 parent 36865cfcf9
commit 63a656cd61
4 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -27,4 +27,4 @@ that log into instances under its control. These accounts are used to
store per player data and authorize management of the cluster. By store per player data and authorize management of the cluster. By
default users accounts are assigned a Player role that gives a limited default users accounts are assigned a Player role that gives a limited
read access to the cluster resources, and admins of the cluster can be read access to the cluster resources, and admins of the cluster can be
assigned an Admin role to get access to manage it. assigned a Cluster Admin role to get access to manage it.
+1 -1
View File
@@ -107,7 +107,7 @@ Replaces the roles the user has in the cluster with a new list of roles.
Calling with an empty roles argument will remove all roles from the Calling with an empty roles argument will remove all roles from the
user. user.
By default there's a roled named Admin which grants access to By default there's a roled named Cluster Admin which grants access to
everything and a role named Player which grants a limited read access to everything and a role named Player which grants a limited read access to
the cluster, see [the section on roles](#roles) for more information the cluster, see [the section on roles](#roles) for more information
about setting up roles and permissions. about setting up roles and permissions.
+1 -1
View File
@@ -102,7 +102,7 @@ class Role {
function ensureDefaultAdminRole(roles) { function ensureDefaultAdminRole(roles) {
let admin = roles.get(0); let admin = roles.get(0);
if (!admin) { if (!admin) {
admin = new Role({ id: 0, name: "Admin", description: "Cluster wide administrator." }); admin = new Role({ id: 0, name: "Cluster Admin", description: "Cluster wide administrator." });
roles.set(0, admin); roles.set(0, admin);
} }
admin.permissions.add("core.admin"); admin.permissions.add("core.admin");
+1 -1
View File
@@ -312,7 +312,7 @@ describe("Integration of Clusterio", function() {
describe("user set-roles", function() { describe("user set-roles", function() {
it("should set the roles on the user", async function() { it("should set the roles on the user", async function() {
await execCtl("user set-roles temp Admin"); await execCtl('user set-roles temp "Cluster Admin"');
let result = await libLink.messages.listUsers.send(getControl()); let result = await libLink.messages.listUsers.send(getControl());
let tempUser = result.list.find(user => user.name === "temp"); let tempUser = result.list.find(user => user.name === "temp");
assert.deepEqual(tempUser.roles, [0]); assert.deepEqual(tempUser.roles, [0]);