Skip to content

Commit 2bf6bfe

Browse files
author
khaled basbous
committed
fix(callback join group): By default give view member permission to invited user
1 parent 5380505 commit 2bf6bfe

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

code/src/com/sixsq/nuvla/server/resources/callback_join_group.clj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ action link to the email address to be verified. When the execute link is
55
visited, the email identifier is marked as validated.
66
"
77
(:require
8+
[com.sixsq.nuvla.auth.acl-resource :as a]
89
[com.sixsq.nuvla.auth.password :as auth-password]
910
[com.sixsq.nuvla.auth.utils :as auth]
1011
[com.sixsq.nuvla.server.resources.callback :as callback]
@@ -41,12 +42,13 @@ visited, the email identifier is marked as validated.
4142

4243
(defn add-user-to-group
4344
[group-id user-id]
44-
(let [{:keys [users]} (crud/retrieve-by-id-as-admin group-id)
45+
(let [{:keys [users acl]} (crud/retrieve-by-id-as-admin group-id)
4546
{:keys [status body]} (crud/edit
4647
{:params {:uuid (u/id->uuid group-id)
4748
:resource-name (u/id->resource-type group-id)}
4849
:nuvla/authn auth/internal-identity
49-
:body {:users (-> users (conj user-id) distinct vec)}})]
50+
:body {:users (-> users (conj user-id) distinct vec)
51+
:acl (a/acl-append acl :view-data user-id)}})]
5052
(if (= 200 status)
5153
body
5254
(let [msg (str (format "adding %s to %s failed:" user-id group-id)

0 commit comments

Comments
 (0)