Begins interface check for permissiont. #274.

This commit is contained in:
Mateus Machado Luna 2019-12-03 15:08:40 -03:00
parent 04a2c7d81a
commit e64e22e74d
5 changed files with 6 additions and 9 deletions

View File

@ -13,7 +13,7 @@
<div class="field is-pulled-right">
<b-dropdown
position="is-bottom-left"
v-if="$userCaps.hasCapability('delete_tainacan-collections')"
v-if="$userCaps.hasCapability('tnc_rep_delete_collections')"
:disabled="!isSelectingCollections"
id="bulk-actions-dropdown"
aria-role="list"

View File

@ -14,7 +14,7 @@
<div class="field is-pulled-right">
<b-dropdown
position="is-bottom-left"
v-if="$userCaps.hasCapability('delete_tainacan-taxonomies')"
v-if="$userCaps.hasCapability('tnc_rep_delete_collections')"
:disabled="!isSelecting"
id="bulk-actions-dropdown"
aria-role="list"

View File

@ -347,10 +347,7 @@ UserCapabilitiesPlugin.install = function (Vue, options = {}) {
Vue.prototype.$userCaps = {
hasCapability(key) {
for (let i = 0; i < tainacan_plugin.user_caps.length; i++)
if (tainacan_plugin.user_caps[i] == key)
return true;
return false;
return tainacan_plugin[key];
}
}
};

View File

@ -5,7 +5,7 @@
:bread-crumb-items="[{ path: '', label: this.$i18n.get('collections') }]"/>
<div
class="sub-header"
v-if="$userCaps.hasCapability('edit_tainacan-collections')">
v-if="$userCaps.hasCapability('tnc_rep_edit_collections')">
<!-- New Collection button -->
<div class="header-item">
@ -212,7 +212,7 @@
{{ $i18n.get('info_no_collections_' + statusOption.slug) }}
</p>
<div v-if="$userCaps.hasCapability('edit_tainacan-collections') && status == undefined || status == ''">
<div v-if="$userCaps.hasCapability('tnc_rep_edit_collections') && status == undefined || status == ''">
<b-dropdown
:disabled="isLoadingMetadatumMappers"
id="collection-creation-options-dropdown"

View File

@ -5,7 +5,7 @@
:bread-crumb-items="[{ path: '', label: this.$i18n.get('taxonomies') }]"/>
<div
class="sub-header"
v-if="$userCaps.hasCapability('edit_tainacan-taxonomies')">
v-if="$userCaps.hasCapability('tnc_rep_edit_taxonomies')">
<!-- New Taxonomy Button ---- -->
<div class="header-item">