mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix root permission
This commit is contained in:
1 parent
0c3847b756
commit
739534f9f7
5 files changed
+12
-4
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.30.6",
|
"version": "2.30.7",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ class DomainModel {
|
|||||||
return roles;
|
return roles;
|
||||||
}
|
}
|
||||||
|
|
||||||
static async setRoles(domainId: string, roles: Dictionary<bigint>) {
|
static async setRoles(domainId: string, roles: Dictionary<bigint | string>) {
|
||||||
deleteUserCache(domainId);
|
deleteUserCache(domainId);
|
||||||
const current = await DomainModel.get(domainId);
|
const current = await DomainModel.get(domainId);
|
||||||
for (const role in roles) {
|
for (const role in roles) {
|
||||||
|
|||||||
@@ -427,6 +427,14 @@ const scripts: UpgradeScript[] = [
|
|||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
async function _38_39() {
|
||||||
|
const _FRESH_INSTALL_IGNORE = 1;
|
||||||
|
await iterateAllDomain(async (ddoc) => {
|
||||||
|
ddoc.roles.root = '-1';
|
||||||
|
await domain.setRoles(ddoc._id, ddoc.roles);
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export default scripts;
|
export default scripts;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/ui-default",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.14.5",
|
"version": "4.14.6",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "hydro.js",
|
"main": "hydro.js",
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
{%- for role in roles -%}
|
{%- for role in roles -%}
|
||||||
<td class="col--p">
|
<td class="col--p">
|
||||||
<label class="compact checkbox">
|
<label class="compact checkbox">
|
||||||
<input name="{{ role._id }}" data-checkbox-group="{{ role._id }}" data-checkbox-range value="1000" type="checkbox" checked{% if role._id == 'admin' %} disabled{% endif %}>
|
<input name="{{ role._id }}" data-checkbox-group="{{ role._id }}" data-checkbox-range value="1000" type="checkbox" checked{% if role._id == 'root' %} disabled{% endif %}>
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
|
|||||||
Reference in new issue
Block a user