data, logs, logs-content, story, story-content: Added permission check in UI to hide disallowed actions.

This commit is contained in:
2018-10-13 12:31:05 +02:00
parent 5187704b02
commit 8345d1fc91
22 changed files with 158 additions and 43 deletions
@@ -3,5 +3,14 @@
<for(chapter in input.story.chapters | status-var=loop)>
<menu-link key=chapter.id on-click("select", "chapter", chapter.id) href=("#" + chapter.id) selected=(state.selectedChapter === chapter.id) icon=(loop.getIndex()+1)>${component.chapterTitle(chapter)}</menu-link>
</for>
<menu-link dark key="_create" on-click("select", "add", null) icon="+">Add Chapter</menu-link>
<if(input.story.open)>
<if-permitted user=input.user permission=["member", "story.edit"]>
<menu-link dark key="_create" on-click("select", "add", null) icon="+">Add Chapter (Open)</menu-link>
</if-permitted>
</if>
<else>
<if-permitted user=input.user author=input.story.author permission="story.edit">
<menu-link dark key="_create" on-click("select", "add", null) icon="+">Add Chapter</menu-link>
</if-permitted>
</else>
</menu>