Skip to content

Commit

Permalink
Merge pull request #20 from oarepo/fix-permission-checking
Browse files Browse the repository at this point in the history
fixed taking permission from session
  • Loading branch information
mirekys authored Dec 6, 2024
2 parents 3863860 + 2fd6ff0 commit 0573d09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions oarepo_dashboard/ui/dashboard_components/search.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from oarepo_ui.resources.components import UIResourceComponent
from flask import current_app, session
from flask import current_app
from oarepo_ui.utils import can_view_deposit_page


class DashboardRecordsSearchComponent(UIResourceComponent):
Expand All @@ -8,7 +9,7 @@ def before_ui_search(self, *, search_options, view_args, extra_context, **kwargs
current_app.config.get("DASHBOARD_RECORD_CREATE_URL", "")
)
search_options["overrides"]["permissions"] = {
"can_create": session["view_deposit_page_permission"]
"can_create": can_view_deposit_page()
}


Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = oarepo-dashboard
version = 1.0.15
version = 1.0.16
description = Support for user dashboard (records, communities, requests)
authors = Mirek Simek <[email protected]>
readme = README.md
Expand Down

0 comments on commit 0573d09

Please sign in to comment.