Skip to content
Snippets Groups Projects
Verified Commit 3ce9455a authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Add permission for menu item

parent ffef71a5
No related branches found
No related tags found
1 merge request!61Release 3.0
......@@ -6,6 +6,14 @@ All notable changes to this project will be documented in this file.
The format is based on `Keep a Changelog`_,
and this project adheres to `Semantic Versioning`_.
Unreleased
----------
Fixed
~~~~~
* Menu item was shown for all users independent of permissions.
`3.0b1` - 2023-03-09
--------------------
......
import { hasPersonValidator } from "aleksis.core/routeValidators";
export default {
meta: {
inMenu: true,
titleKey: "resint.menu_title",
icon: "mdi-open-in-app",
validators: [hasPersonValidator],
permission: "resint.view_menu_rule",
},
children: [
{
......
......@@ -140,3 +140,10 @@ delete_live_document_predicate = view_live_documents_predicate & has_global_perm
"resint.delete_livedocument"
)
add_perm("resint.delete_livedocument_rule", delete_live_document_predicate)
# View menu
view_menu_predicate = (
view_posters_predicate | view_poster_groups_predicate | view_live_documents_predicate
)
add_perm("resint.view_menu_rule", view_menu_predicate)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment