1
0
mirror of https://github.com/typemill/typemill.git synced 2025-07-30 10:50:17 +02:00

Version 1.3.8: Roles and rights

This commit is contained in:
trendschau
2020-07-17 11:17:42 +02:00
parent 93afe9f845
commit 591190410f
15 changed files with 82 additions and 79 deletions

View File

@@ -329,7 +329,8 @@ class PageController extends Controller
foreach ($structure as $key => $item)
{
$filename = ($item->elementType == 'folder') ? DIRECTORY_SEPARATOR . 'index.yaml' : $item->pathWithoutType . '.yaml';
# $filename = ($item->elementType == 'folder') ? DIRECTORY_SEPARATOR . 'index.yaml' : $item->pathWithoutType . '.yaml';
$filename = $item->pathWithoutType . '.yaml';
if(file_exists($contentPath . $filename))
{

View File

@@ -702,7 +702,7 @@ class SettingsController extends Controller
$user = new User();
$validate = new Validation();
$userroles = $this->c->acl->getRoles();
$redirectRoute = ($userdata['username'] == $_SESSION['user']) ? $this->c->router->pathFor('user.account') : $this->c->router->pathFor('user.show', ['username' => $userdata['username']]);
# check if user is allowed to view (edit) userlist and other users
@@ -833,11 +833,13 @@ class SettingsController extends Controller
$fields = $this->c->dispatcher->dispatch('onUserfieldsLoaded', new OnUserfieldsLoaded($fields))->getData();
# only roles who can edit content need profile image and description
if($this->c->acl->isAllowed($role, 'content', 'create'))
if($this->c->acl->isAllowed($role, 'mycontent', 'create'))
{
$newfield['image'] = ['label' => 'Profile-Image', 'type' => 'image'];
$newfield['description'] = ['label' => 'Author-Description (Markdown)', 'type' => 'textarea'];
array_splice($fields,1,0,$newfield);
$fields = array_slice($fields, 0, 1, true) + $newfield + array_slice($fields, 1, NULL, true);
# array_splice($fields,1,0,$newfield);
}
# Only admin can change userroles

View File

@@ -82,7 +82,7 @@ class Settings
'contentFolder' => 'content',
'cache' => true,
'cachePath' => $rootPath . 'cache',
'version' => '1.3.7.2',
'version' => '1.3.8',
'setup' => true,
'welcome' => true,
'images' => ['live' => ['width' => 820], 'thumbs' => ['width' => 250, 'height' => 150]],

View File

@@ -2175,7 +2175,7 @@ const medialib = Vue.component('medialib', {
this.$parent.showmedialib = false;
this.$parent.createmarkdown();
this.$parent.createmarkdown(image.src_live);
/* this.$parent.updatemarkdown(imgmarkdown, image.src_live); */
}
if(this.parentcomponent == 'files')
@@ -2209,7 +2209,7 @@ const medialib = Vue.component('medialib', {
this.$parent.showmedialib = false;
this.$parent.createmarkdown();
this.$parent.createmarkdown(file.url);
/* this.$parent.updatemarkdown(imgmarkdown, file.url);*/
}
if(this.parentcomponent == 'files')

View File

@@ -64,6 +64,11 @@ Vue.component('component-image', {
/* is called from child component medialib */
this.update(url);
},
createmarkdown: function(url)
{
/* is called from child component medialib */
this.update(url);
},
deleteImage: function()
{
this.imgpreview = false;

View File

@@ -19,8 +19,8 @@
<link rel="apple-touch-icon" sizes="180x180" href="{{ base_url }}/system/author/img/favicon-180.png" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/tachyons.min.css?20200614" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200614" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/tachyons.min.css?20200716" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200716" />
</head>
<body>
<svg style="position: absolute; width: 0; height: 0; overflow: hidden" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
@@ -74,14 +74,14 @@
<footer></footer>
</div>
<!-- <script src="{{ base_url }}/system/author/js/color-picker.min.js?20200505"></script> -->
<script src="{{ base_url }}/system/author/js/axios.min.js?20200226"></script>
<script src="{{ base_url }}/system/author/js/axios.min.js?20200716"></script>
<script>
const myaxios = axios.create();
myaxios.defaults.baseURL = "{{ base_url }}";
</script>
<script src="{{ base_url }}/system/author/js/vue.min.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/author.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/typemillutils.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/vue.min.js?20200716"></script>
<script src="{{ base_url }}/system/author/js/author.js?20200716"></script>
<script src="{{ base_url }}/system/author/js/typemillutils.js?20200716"></script>
<script>
typemillUtilities.start()
</script>

View File

@@ -20,7 +20,7 @@
<link rel="apple-touch-icon" sizes="180x180" href="{{ base_url }}/system/author/img/favicon-180.png" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200614" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200716" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/color-picker.min.css" />
</head>
<body>
@@ -56,6 +56,6 @@
{% block content %}{% endblock %}
</div>
<script src="{{ base_url }}/system/author/js/auth.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/auth.js?20200716"></script>
</body>
</html>

View File

@@ -19,7 +19,7 @@
<link rel="apple-touch-icon" sizes="180x180" href="{{ base_url }}/system/author/img/favicon-180.png" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200614" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200716" />
</head>
<body>
<svg style="position: absolute; width: 0; height: 0; overflow: hidden" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">

View File

@@ -20,7 +20,7 @@
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/tachyons.min.css" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200614" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200716" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/color-picker.min.css" />
{{ assets.renderCSS() }}
@@ -197,17 +197,17 @@
</article>
<footer></footer>
</div>
<script src="{{ base_url }}/system/author/js/axios.min.js?20200226"></script>
<script src="{{ base_url }}/system/author/js/axios.min.js?20200716"></script>
<script>
const myaxios = axios.create();
myaxios.defaults.baseURL = "{{ base_url }}";
</script>
<script src="{{ base_url }}/system/author/js/typemillutils.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/vue.min.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/autosize.min.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/author.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/vue-publishcontroller.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/vue-blox-config.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/typemillutils.js?20200716"></script>
<script src="{{ base_url }}/system/author/js/vue.min.js?20200716"></script>
<script src="{{ base_url }}/system/author/js/autosize.min.js?20200716"></script>
<script src="{{ base_url }}/system/author/js/author.js?20200716"></script>
<script src="{{ base_url }}/system/author/js/vue-publishcontroller.js?20200716"></script>
<script src="{{ base_url }}/system/author/js/vue-blox-config.js?20200716"></script>
<script>
let formatConfig = {{ settings.formats|json_encode() }};
let language = {{ settings.language|json_encode() }};
@@ -217,13 +217,13 @@
{{ assets.renderEditorJS() }}
<script src="{{ base_url }}/system/author/js/vue-blox.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/vue-posts.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/sortable.min.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/vuedraggable.umd.min.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/vue-navi.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/vue-shared.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/vue-meta.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/vue-blox.js?20200716"></script>
<script src="{{ base_url }}/system/author/js/vue-posts.js?20200716"></script>
<script src="{{ base_url }}/system/author/js/sortable.min.js?20200716"></script>
<script src="{{ base_url }}/system/author/js/vuedraggable.umd.min.js?20200716"></script>
<script src="{{ base_url }}/system/author/js/vue-navi.js?20200716"></script>
<script src="{{ base_url }}/system/author/js/vue-shared.js?20200716"></script>
<script src="{{ base_url }}/system/author/js/vue-meta.js?20200716"></script>
{{ assets.renderJS() }}

View File

@@ -19,7 +19,7 @@
<link rel="apple-touch-icon" sizes="180x180" href="{{ base_url }}/system/author/img/favicon-180.png" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200614" />
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20200716" />
{{ assets.renderCSS() }}
@@ -83,16 +83,16 @@
</article>
<footer></footer>
</div>
<script src="{{ base_url }}/system/author/js/axios.min.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/axios.min.js?20200716"></script>
<script>
const myaxios = axios.create();
myaxios.defaults.baseURL = "{{ base_url }}";
</script>
<script src="{{ base_url }}/system/author/js/vue.min.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/autosize.min.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/sortable.min.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/vuedraggable.umd.min.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/author.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/vue.min.js?20200716"></script>
<script src="{{ base_url }}/system/author/js/autosize.min.js?20200716"></script>
<script src="{{ base_url }}/system/author/js/sortable.min.js?20200716"></script>
<script src="{{ base_url }}/system/author/js/vuedraggable.umd.min.js?20200716"></script>
<script src="{{ base_url }}/system/author/js/author.js?20200716"></script>
<script>
let language = {{ settings.language|json_encode() }};
@@ -102,10 +102,10 @@
{{ assets.renderEditorJS() }}
<script src="{{ base_url }}/system/author/js/vue-publishcontroller.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/vue-editor.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/vue-meta.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/vue-navi.js?20200614"></script>
<script src="{{ base_url }}/system/author/js/vue-publishcontroller.js?20200716"></script>
<script src="{{ base_url }}/system/author/js/vue-editor.js?20200716"></script>
<script src="{{ base_url }}/system/author/js/vue-meta.js?20200716"></script>
<script src="{{ base_url }}/system/author/js/vue-navi.js?20200716"></script>
{{ assets.renderJS() }}