Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org) using the following scheme: MAJOR.MINOR.PATCH

## [0.58.0] - 2026-07-08

### Added
- Multicompany user permissions

## [0.57.0] - 2026-07-07

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public struct DolibarrUserPermissions: Codable, Hashable {
public var stock: DolibarrUserPermissionsStock?
public var projet: DolibarrUserPermissionsProject?
public var lareponse: DolibarrUserPermissionsLaReponse?
public var multicompany: DolibarrUserPermissionsMulticompany?

// MARK: - Inits

Expand All @@ -63,7 +64,8 @@ public struct DolibarrUserPermissions: Codable, Hashable {
barcode: DolibarrUserPermissionsBarcode? = nil,
stock: DolibarrUserPermissionsStock? = nil,
projet: DolibarrUserPermissionsProject? = nil,
lareponse: DolibarrUserPermissionsLaReponse? = nil
lareponse: DolibarrUserPermissionsLaReponse? = nil,
multicompany: DolibarrUserPermissionsMulticompany? = nil
) {
self.user = user
self.expensereport = expensereport
Expand All @@ -79,6 +81,7 @@ public struct DolibarrUserPermissions: Codable, Hashable {
self.stock = stock
self.projet = projet
self.lareponse = lareponse
self.multicompany = multicompany
}

public init(from decoder: any Decoder) throws {
Expand All @@ -97,6 +100,7 @@ public struct DolibarrUserPermissions: Codable, Hashable {
self.stock = try container.decodeIfPresent(DolibarrUserPermissionsStock.self, forKey: .stock)
self.projet = try container.decodeIfPresent(DolibarrUserPermissionsProject.self, forKey: .projet)
self.lareponse = try container.decodeIfPresent(DolibarrUserPermissionsLaReponse.self, forKey: .lareponse)
self.multicompany = try container.decodeIfPresent(DolibarrUserPermissionsMulticompany.self, forKey: .multicompany)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

//
// File.swift
// DolibarrUserPermissionsInvoice.swift
// SwiftDolibarr
//
// Created by William Mead on 09/03/2026.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// Copyright 2026 M34D - William Mead
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// DolibarrUserPermissionsMulticompany.swift
// SwiftDolibarr
//
// Created by William Mead on 07/07/2026.
//

import Foundation

/// Multicompany module permissions for a Dolibarr user.
///
/// - SeeAlso: ``DolibarrUserPermissions``
public struct DolibarrUserPermissionsMulticompany: Codable, Hashable {

// MARK: - Properties

public var read: Int?
public var write: Int?
public var delete: Int?
public var create: Int?

// MARK: - Enums

enum CodingKeys: String, CodingKey {
case read
case write
case delete
case create
}

// MARK: - Inits

public init(
read: Int? = nil,
write: Int? = nil,
delete: Int? = nil,
create: Int? = nil
) {
self.read = read
self.write = write
self.delete = delete
self.create = create
}

public init(from decoder: any Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.read = try container.decodeIfPresent(Int.self, forKey: .read)
self.write = try container.decodeIfPresent(Int.self, forKey: .write)
self.delete = try container.decodeIfPresent(Int.self, forKey: .delete)
self.create = try container.decodeIfPresent(Int.self, forKey: .create)
}

}
Loading