models/communities/Role.js

/** @class Role */
export default class Role {
    /**
     * Return name for a given role
     *
     * @memberof Role
     * @returns {string} Role name
     */
    static valueToName(value) {
        switch (value) {
            case Role.Owner:
                return 'owner';
            case Role.Admin:
                return 'admin';
            case Role.Member:
                return 'member';
            case Role.Follower:
                return 'follower';
            case Role.Everyone:
                return 'everyone';
        }
    }
}

/** @memberof Role */
Role.Owner = 0;
/** @memberof Role */
Role.Admin = 1;
/** @memberof Role */
Role.Member = 3;
/** @memberof Role */
Role.Follower = 4;
/** @memberof Role */
Role.Everyone = 5;