File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,14 @@ def list_my_collections(
6060 .scalars ()
6161 .all ()
6262 )
63+ # filter score sets and experiments based on user permissions
64+ for item in collection_bundle [role .value ]:
65+ item .score_sets = [
66+ score_set for score_set in item .score_sets if has_permission (user_data , score_set , Action .READ )
67+ ]
68+ item .experiments = [
69+ experiment for experiment in item .experiments if has_permission (user_data , experiment , Action .READ )
70+ ]
6371
6472 return collection_bundle
6573
@@ -87,8 +95,6 @@ def fetch_collection(
8795 logger .debug (msg = "The requested collection does not exist." , extra = logging_context ())
8896 raise HTTPException (status_code = 404 , detail = f"Collection with URN { urn } not found" )
8997
90- # TODO return admin view if user is mavedb admin? not done for score sets or experiments
91-
9298 assert_permission (user_data , item , Action .READ )
9399 # filter score sets and experiments based on user permissions
94100 item .score_sets = [score_set for score_set in item .score_sets if has_permission (user_data , score_set , Action .READ )]
You can’t perform that action at this time.
0 commit comments