@umbraco/json-models-builders
Version:
Builders and models for Umbraco Sites
154 lines • 4.5 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UserGroupsPermissionsBaseBuilder = void 0;
class UserGroupsPermissionsBaseBuilder {
parentBuilder;
read = false;
createDocumentBlueprint = false;
delete = false;
create;
notifications = false;
publish = false;
setPermissions = false;
unpublish = false;
update = false;
duplicate = false;
moveTo = false;
sortChildren = false;
cultureAndHostnames = false;
publicAccess = false;
rollback = false;
readPropertyValue = false;
writePropertyValue = false;
constructor(parentBuilder) {
this.parentBuilder = parentBuilder;
}
withReadPermission(read) {
this.read = read;
return this;
}
withCreateDocumentBlueprintPermission(createDocumentBlueprint) {
this.createDocumentBlueprint = createDocumentBlueprint;
return this;
}
withDeletePermission(deletePermission) {
this.delete = deletePermission;
return this;
}
withCreatePermission(createPermission) {
this.create = createPermission;
return this;
}
withNotificationsPermission(notifications) {
this.notifications = notifications;
return this;
}
withPublishPermission(publish) {
this.publish = publish;
return this;
}
withSetPermissionsPermission(setPermissions) {
this.setPermissions = setPermissions;
return this;
}
withUnpublishPermission(unpublish) {
this.unpublish = unpublish;
return this;
}
withUpdatePermission(update) {
this.update = update;
return this;
}
withDuplicatePermission(duplicate) {
this.duplicate = duplicate;
return this;
}
withMoveToPermission(moveTo) {
this.moveTo = moveTo;
return this;
}
withSortChildrenPermission(sortChildren) {
this.sortChildren = sortChildren;
return this;
}
withCultureAndHostnamesPermission(cultureAndHostnames) {
this.cultureAndHostnames = cultureAndHostnames;
return this;
}
withPublicAccessPermission(publicAccess) {
this.publicAccess = publicAccess;
return this;
}
withRollbackPermission(rollback) {
this.rollback = rollback;
return this;
}
withReadPropertyValuePermission(readPropertyValue) {
this.readPropertyValue = readPropertyValue;
return this;
}
withWritePropertyValuePermission(writePropertyValue) {
this.writePropertyValue = writePropertyValue;
return this;
}
done() {
return this.parentBuilder;
}
build() {
let values = [];
if (this.read) {
values.push('Umb.Document.Read');
}
if (this.createDocumentBlueprint) {
values.push('Umb.Document.CreateBlueprint');
}
if (this.delete) {
values.push('Umb.Document.Delete');
}
if (this.create) {
values.push('Umb.Document.Create');
}
if (this.notifications) {
values.push('Umb.Document.Notifications');
}
if (this.publish) {
values.push('Umb.Document.Publish');
}
if (this.setPermissions) {
values.push('Umb.Document.Permissions');
}
if (this.unpublish) {
values.push('Umb.Document.Unpublish');
}
if (this.update) {
values.push('Umb.Document.Update');
}
if (this.duplicate) {
values.push('Umb.Document.Duplicate');
}
if (this.moveTo) {
values.push('Umb.Document.Move');
}
if (this.sortChildren) {
values.push('Umb.Document.Sort');
}
if (this.cultureAndHostnames) {
values.push('Umb.Document.CultureAndHostnames');
}
if (this.publicAccess) {
values.push('Umb.Document.PublicAccess');
}
if (this.rollback) {
values.push('Umb.Document.Rollback');
}
if (this.readPropertyValue) {
values.push('Umb.Document.PropertyValue.Read');
}
if (this.writePropertyValue) {
values.push('Umb.Document.PropertyValue.Write');
}
return values;
}
}
exports.UserGroupsPermissionsBaseBuilder = UserGroupsPermissionsBaseBuilder;
//# sourceMappingURL=userGroupsPermissionsBaseBuilder.js.map