mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 01:38:19 +08:00
core&ui: add allow invite option
This commit is contained in:
3 files changed
+3
-2
No files matched your search
@@ -175,7 +175,7 @@ class DomainUserHandler extends ManageHandler {
|
||||
@param('role', Types.Role)
|
||||
@param('join', Types.Boolean)
|
||||
async postSetUsers(domainId: string, uid: number[], role: string, join = false) {
|
||||
if (join) this.checkPriv(PRIV.PRIV_MANAGE_ALL_DOMAIN);
|
||||
if (join && !system.get('server.allowInvite')) this.checkPriv(PRIV.PRIV_MANAGE_ALL_DOMAIN);
|
||||
await Promise.all([
|
||||
domain.setUserRole(domainId, uid, role),
|
||||
oplog.log(this, 'domain.setRole', { uid, role, join }),
|
||||
|
||||
@@ -314,6 +314,7 @@ SystemSetting(Schema.object({
|
||||
verify: Schema.boolean().default(true).description('Verify register email'),
|
||||
}).extra('family', 'setting_smtp'),
|
||||
server: Schema.object({
|
||||
allowInvite: Schema.boolean().default(true).description('Allow invite users'),
|
||||
center: Schema.string().default('https://hydro.ac/center').description('Server Center').role('url').hidden(),
|
||||
name: Schema.string().default('Hydro').description('Server Name'),
|
||||
url: Schema.string().default('/').description('Server BaseURL'),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "domain_base.html" %}
|
||||
{% block domain_content %}
|
||||
{{ set(UiContext, 'roles', roles.map(eval('(i) => i._id'))) }}
|
||||
{{ set(UiContext, 'canForceJoin', handler.user.hasPriv(PRIV.PRIV_MANAGE_ALL_DOMAIN)) }}
|
||||
{{ set(UiContext, 'canForceJoin', model.system.get('server.allowInvite') or handler.user.hasPriv(PRIV.PRIV_MANAGE_ALL_DOMAIN)) }}
|
||||
{% set _rolesSelect = roles.filter(eval("(i) => i._id !== 'guest'")).map(eval('(role) => [role._id, role._id]')) %}
|
||||
<div class="section">
|
||||
<div class="section__header">
|
||||
|
||||
Reference in new issue
Block a user