mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Fix news related permission issues (#15287)
This commit is contained in:
@@ -297,7 +297,7 @@
|
|||||||
<div class="topbar-dropdown">
|
<div class="topbar-dropdown">
|
||||||
<router-link
|
<router-link
|
||||||
v-if="user.permissions.fullAccess ||
|
v-if="user.permissions.fullAccess ||
|
||||||
user.permissions.userSupport || user.permissions.newsPoster"
|
user.permissions.userSupport"
|
||||||
class="topbar-dropdown-item dropdown-item"
|
class="topbar-dropdown-item dropdown-item"
|
||||||
:to="{name: 'adminPanel'}"
|
:to="{name: 'adminPanel'}"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ export default {
|
|||||||
if (lastPublishedPost) this.posts.push(lastPublishedPost);
|
if (lastPublishedPost) this.posts.push(lastPublishedPost);
|
||||||
|
|
||||||
// If the user is authorized, show any draft
|
// If the user is authorized, show any draft
|
||||||
if (this.user && this.user.contributor.newsPoster) {
|
if (this.user && (this.user.permissions.news || this.user.permissions.fullAccess)) {
|
||||||
this.posts.unshift(
|
this.posts.unshift(
|
||||||
...postsFromServer
|
...postsFromServer
|
||||||
.filter(p => !p.published || moment().isBefore(p.publishDate)),
|
.filter(p => !p.published || moment().isBefore(p.publishDate)),
|
||||||
|
|||||||
@@ -190,7 +190,6 @@ const router = new VueRouter({
|
|||||||
meta: {
|
meta: {
|
||||||
privilegeNeeded: [ // any one of these is enough to give access
|
privilegeNeeded: [ // any one of these is enough to give access
|
||||||
'userSupport',
|
'userSupport',
|
||||||
'newsPoster',
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
Reference in New Issue
Block a user