Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #267

Merged
merged 3 commits into from
May 15, 2024
Merged

Dev #267

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
21 changes: 21 additions & 0 deletions src/cral/model/alfresco/access_status.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
; CRAL
; Copyright (C) 2023-2024 Saidone
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program. If not, see <http://www.gnu.org/licenses/>.

(ns cral.model.alfresco.access-status)

(def ^:const allowed "ALLOWED")
(def ^:const denied "DENIED")
(def ^:const undetermined "UNDETERMINED")
24 changes: 24 additions & 0 deletions src/cral/model/alfresco/permissions.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
; CRAL
; Copyright (C) 2023-2024 Saidone
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program. If not, see <http://www.gnu.org/licenses/>.

(ns cral.model.alfresco.permissions)

(def ^:const coordinator "Coordinator")
(def ^:const collaborator "Collaborator")
(def ^:const contributor "Contributor")
(def ^:const editor "Editor")
(def ^:const consumer "Consumer")
(def ^:const record-administrator "RecordAdministrator")
4 changes: 2 additions & 2 deletions src/cral/model/alfresco/ratings.clj
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@

(ns cral.model.alfresco.ratings)

(def likes "likes")
(def five-star "fiveStar")
(def ^:const likes "likes")
(def ^:const five-star "fiveStar")
8 changes: 4 additions & 4 deletions src/cral/model/alfresco/roles.clj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

(ns cral.model.alfresco.roles)

(def site-consumer "SiteConsumer")
(def site-collaborator "SiteCollaborator")
(def site-contributor "SiteContributor")
(def site-manager "SiteManager")
(def ^:const site-consumer "SiteConsumer")
(def ^:const site-collaborator "SiteCollaborator")
(def ^:const site-contributor "SiteContributor")
(def ^:const site-manager "SiteManager")
6 changes: 4 additions & 2 deletions test/cral/nodes_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
[clojure.test :refer :all]
[cral.api.auth :as auth]
[cral.api.core.nodes :as nodes]
[cral.model.alfresco.permissions :as permissions]
[cral.model.alfresco.access-status :as status]
[cral.config :as c]
[cral.fixtures :as fixtures]
[cral.model.alfresco.cm :as cm]
Expand Down Expand Up @@ -53,8 +55,8 @@
;; update node with new permissions
(->> (model/map->UpdateNodeBody {:permissions (model/map->Permissions {:is-inheritance-enabled false
:locally-set [{:authority-id "guest"
:name "Write"
:access-status "ALLOWED"}]})})
:name permissions/editor
:access-status status/allowed}]})})
(nodes/update-node ticket created-node-id))
; check if new permissions have been applied
(let [permissions (get-in (nodes/get-node ticket created-node-id (model/map->GetNodeQueryParams {:include "permissions"})) [:body :entry :permissions])]
Expand Down