From f067feb37a5f19bd4a1ab314447c307c4d91af31 Mon Sep 17 00:00:00 2001 From: Kalila L Date: Fri, 19 Mar 2021 04:44:58 -0400 Subject: [PATCH] Add docs for ban functionality. --- .../script-engine/src/UsersScriptingInterface.h | 8 ++++++-- libraries/shared/src/ModerationFlags.h | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/libraries/script-engine/src/UsersScriptingInterface.h b/libraries/script-engine/src/UsersScriptingInterface.h index e61c8734f3..a02553eca8 100644 --- a/libraries/script-engine/src/UsersScriptingInterface.h +++ b/libraries/script-engine/src/UsersScriptingInterface.h @@ -33,6 +33,10 @@ * false. Read-only. * @property {boolean} requestsDomainListData - true if the client requests extra data from the mixers (such as * positional data of an avatar they've ignored). Read-only. + * @property {BanFlags} NO_BAN - Do not ban person. Read-only. + * @property {BanFlags} BAN_BY_USERNAME - Ban person by username. Read-only. + * @property {BanFlags} BAN_BY_FINGERPRINT - Ban person by fingerprint. Read-only. + * @property {BanFlags} BAN_BY_IP - Ban person by IP address. Read-only. */ class UsersScriptingInterface : public QObject, public Dependency { Q_OBJECT @@ -118,8 +122,8 @@ public slots: float getAvatarGain(const QUuid& nodeID); /**jsdoc - * Kicks and bans a user. This removes them from the server and prevents them from returning. The ban is by user name if - * available and by machine fingerprint. The ban functionality can be controlled with flags. + * Kicks and bans a user. This removes them from the server and prevents them from returning. The ban is by user name (if + * available) and by machine fingerprint. The ban functionality can be controlled with flags. *

This function only works if you're an administrator of the domain you're in.

* @function Users.kick * @param {Uuid} sessionID - The session ID of the user to kick and ban. diff --git a/libraries/shared/src/ModerationFlags.h b/libraries/shared/src/ModerationFlags.h index 2724e353e6..9bdd4bfbea 100644 --- a/libraries/shared/src/ModerationFlags.h +++ b/libraries/shared/src/ModerationFlags.h @@ -14,6 +14,23 @@ class ModerationFlags { public: + + /**jsdoc + *

A set of flags for moderation ban actions. The value is constructed by using the | (bitwise OR) operator on the + * individual flag values.

+ * + * + * + * + * + * + * + * + * + * + *
Flag NameValueDescription
NO_BAN0Don't ban user when kicking. This does not currently have an effect.
BAN_BY_USERNAME1Ban the person by their username.
BAN_BY_FINGERPRINT2Ban the person by their machine fingerprint.
BAN_BY_IP4Ban the person by their IP address.
+ * @typedef {number} BanFlags + */ enum BanFlags { NO_BAN = 0,