Skip to content

Commit

Permalink
PM-12243: Fix organization permissions JSON decoding errors for remov…
Browse files Browse the repository at this point in the history
…ed properties (#934)
  • Loading branch information
matt-livefront authored Sep 16, 2024
1 parent 6eeaa1b commit 846669a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,12 @@

extension Permissions {
static func fixture(
accessEventLogs: Bool = false,
accessImportExport: Bool = false,
accessReports: Bool = false,
createNewCollections: Bool = false,
deleteAnyCollection: Bool = false,
deleteAssignedCollections: Bool = false,
editAnyCollection: Bool = false,
editAssignedCollections: Bool = false,
manageGroups: Bool = false,
managePolicies: Bool = false,
manageResetPassword: Bool = false,
manageScim: Bool = false,
manageSso: Bool = false,
manageUsers: Bool = false
manageResetPassword: Bool = false
) -> Permissions {
self.init(
accessEventLogs: accessEventLogs,
accessImportExport: accessImportExport,
accessReports: accessReports,
createNewCollections: createNewCollections,
deleteAnyCollection: deleteAnyCollection,
deleteAssignedCollections: deleteAssignedCollections,
editAnyCollection: editAnyCollection,
editAssignedCollections: editAssignedCollections,
manageGroups: manageGroups,
managePolicies: managePolicies,
manageResetPassword: manageResetPassword,
manageScim: manageScim,
manageSso: manageSso,
manageUsers: manageUsers
manageResetPassword: manageResetPassword
)
}
}
50 changes: 1 addition & 49 deletions BitwardenShared/Core/Vault/Models/API/Permissions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,68 +3,20 @@
struct Permissions: Codable, Equatable, Hashable {
// MARK: Properties

/// Whether the user can access event logs.
let accessEventLogs: Bool

/// Whether the user can access import and export.
let accessImportExport: Bool

/// Whether the user can access reports.
let accessReports: Bool

/// Whether the user can create new collections.
let createNewCollections: Bool

/// Whether the user can delete any collection.
let deleteAnyCollection: Bool

/// Whether the user can delete assigned collections.
let deleteAssignedCollections: Bool

/// Whether the user can edit any collection.
let editAnyCollection: Bool

/// Whether the user can edit assigned collections.
let editAssignedCollections: Bool

/// Whether the user can manage groups.
let manageGroups: Bool

/// Whether the user can manage policies.
let managePolicies: Bool

/// Whether the user can manage reset password.
let manageResetPassword: Bool

/// Whether the user can manage SCIM.
let manageScim: Bool

/// Whether the user can manage SSO.
let manageSso: Bool

/// Whether the user can manager users.
let manageUsers: Bool
}

extension Permissions {
/// Initialize `Permissions` with default values.
///
init() {
self.init(
accessEventLogs: false,
accessImportExport: false,
accessReports: false,
createNewCollections: false,
deleteAnyCollection: false,
deleteAssignedCollections: false,
editAnyCollection: false,
editAssignedCollections: false,
manageGroups: false,
managePolicies: false,
manageResetPassword: false,
manageScim: false,
manageSso: false,
manageUsers: false
manageResetPassword: false
)
}
}

0 comments on commit 846669a

Please sign in to comment.