mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-13 10:42:56 +01:00
@@ -151,8 +151,8 @@ export default Vue.extend({
|
||||
return DateTime.fromISO(s).toFormat(format);
|
||||
},
|
||||
hasRole: function (s: string): boolean {
|
||||
if (this.$store.state.user.roles) {
|
||||
return this.lodash.includes(this.$store.state.user.roles, s);
|
||||
if (this.$store.state.settings.roles) {
|
||||
return this.lodash.includes(this.$store.state.settings.roles, s);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@ export default Vue.extend({
|
||||
return true;
|
||||
}
|
||||
let has = false;
|
||||
if (this.$store.state.user.roles) {
|
||||
this.lodash.forEach(this.$store.state.user.roles, (userRole) => {
|
||||
if (this.$store.state.settings.roles) {
|
||||
this.lodash.forEach(this.$store.state.settings.roles, (userRole) => {
|
||||
if (link.role === userRole || this.lodash.startsWith(link.role, userRole + ":")) {
|
||||
has = true;
|
||||
}
|
||||
|
||||
@@ -119,8 +119,8 @@ export default Vue.extend({
|
||||
this.dialog = false;
|
||||
},
|
||||
hasRole: function (s: string): boolean {
|
||||
if (this.$store.state.user.roles) {
|
||||
return this.lodash.includes(this.$store.state.user.roles, s);
|
||||
if (this.$store.state.settings.roles) {
|
||||
return this.lodash.includes(this.$store.state.settings.roles, s);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user