@manuth/woltlab-compiler
Version:
A compiler for generating WoltLab-Package `.tar` Archives and other WoltLab-Package Components
99 lines • 2.96 kB
JavaScript
import { Option } from "../Option.js";
/**
* Represents an option which controls the permission of a user-group.
*/
export class GroupOption extends Option {
/**
* Initializes a new instance of the {@link GroupOption `GroupOption`} class.
*
* @param category
* The category of the group-option.
*
* @param options
* The options of the group-option.
*/
constructor(category, options) {
super(category, options);
/**
* The default value for groups which apply to registered users.
*/
this.userDefaultValue = null;
/**
* The default value for groups which have access to the moderation-section.
*/
this.modDefaultValue = null;
/**
* The default value for groups with administrator permissions.
*/
this.adminDefaultValue = null;
/**
* A value indicating whether the option only applies to groups for registered users.
*/
this.registeredOnly = false;
if ((options.UserDefaultValue !== null) &&
(options.UserDefaultValue !== undefined)) {
this.UserDefaultValue = options.UserDefaultValue;
}
if ((options.ModDefaultValue !== null) &&
(options.ModDefaultValue !== undefined)) {
this.ModDefaultValue = options.ModDefaultValue;
}
if ((options.AdminDefaultValue !== null) &&
(options.AdminDefaultValue !== undefined)) {
this.AdminDefaultValue = options.AdminDefaultValue;
}
if ((options.RegisteredOnly !== null) &&
(options.RegisteredOnly !== undefined)) {
this.RegisteredOnly = options.RegisteredOnly;
}
}
/**
* Gets or sets the default value for groups which apply to registered users.
*/
get UserDefaultValue() {
return this.userDefaultValue;
}
/**
* @inheritdoc
*/
set UserDefaultValue(value) {
this.userDefaultValue = value;
}
/**
* Gets or sets the default value for groups which have access to the moderation-section.
*/
get ModDefaultValue() {
return this.modDefaultValue;
}
/**
* @inheritdoc
*/
set ModDefaultValue(value) {
this.modDefaultValue = value;
}
/**
* Gets or sets the default value for groups with administrator permissions.
*/
get AdminDefaultValue() {
return this.adminDefaultValue;
}
/**
* @inheritdoc
*/
set AdminDefaultValue(value) {
this.adminDefaultValue = value;
}
/**
* Gets or sets a value indicating whether the option only applies to groups for registered users.
*/
get RegisteredOnly() {
return this.registeredOnly;
}
/**
* @inheritdoc
*/
set RegisteredOnly(value) {
this.registeredOnly = value;
}
}
//# sourceMappingURL=GroupOption.js.map