Overte C++ Documentation
ModerationFlags.h
1 //
2 // ModerationFlags.h
3 // libraries/shared/src
4 //
5 // Created by Kalila L. on Mar 11 2021.
6 // Copyright 2021 Vircadia contributors.
7 //
8 // Distributed under the Apache License, Version 2.0.
9 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
10 //
11 
12 #ifndef overte_ModerationFlags_h
13 #define overte_ModerationFlags_h
14 
15 class ModerationFlags {
16 public:
17 
18  /*@jsdoc
19  * <p>A set of flags for moderation ban actions. The value is constructed by using the <code>|</code> (bitwise OR) operator on the
20  * individual flag values.</p>
21  * <table>
22  * <thead>
23  * <tr><th>Flag Name</th><th>Value</th><th>Description</th></tr>
24  * </thead>
25  * <tbody>
26  * <tr><td>NO_BAN</td><td><code>0</code></td><td>Don't ban user when kicking. <em>This does not currently have an effect.</em></td></tr>
27  * <tr><td>BAN_BY_USERNAME</td><td><code>1</code></td><td>Ban the person by their username.</td></tr>
28  * <tr><td>BAN_BY_FINGERPRINT</td><td><code>2</code></td><td>Ban the person by their machine fingerprint.</td></tr>
29  * <tr><td>BAN_BY_IP</td><td><code>4</code></td><td>Ban the person by their IP address.</td></tr>
30  * </tbody>
31  * </table>
32  * @typedef {number} BanFlags
33  */
34  enum BanFlags
35  {
36  NO_BAN = 0,
37  BAN_BY_USERNAME = 1,
38  BAN_BY_FINGERPRINT = 2,
39  BAN_BY_IP = 4
40  };
41 
42  static constexpr unsigned int getDefaultBanFlags() { return (BanFlags::BAN_BY_USERNAME | BanFlags::BAN_BY_FINGERPRINT); };
43 };
44 
45 #endif // overte_ModerationFlags_h