Fixes collection select not updating specific permissions. #274.

This commit is contained in:
Mateus Machado Luna 2019-11-29 10:02:45 -03:00
parent e8e6bdc160
commit 2588310129
2 changed files with 6 additions and 6 deletions

View File

@ -201,7 +201,8 @@
<td
class="name column-name"
:data-colname="$i18n.get('Capability name')">
<strong>{{ capability.display_name }}</strong>
<!-- <strong>{{ capability.display_name }}</strong> -->
<strong>{{ index.replace('%d', selectedCollection) }}</strong>
</td>
<td
class="description column-descritption"

View File

@ -7,9 +7,8 @@ export const addCapabilityToRole = (state, {capabilityKey, role}) => {
updateRoles[role.slug] = role;
Vue.set(state.capabilities[capabilityKey], 'roles', updateRoles)
}
if (state.role && state.role.slug && state.role.slug == role)
Vue.set(state.role.capabilities, capabilityKey, true)
if (state.role && state.role.slug && state.role.slug == role.slug)
state.role = role;
};
export const removeCapabilityFromRole = (state, {capabilityKey, role}) => {
@ -18,8 +17,8 @@ export const removeCapabilityFromRole = (state, {capabilityKey, role}) => {
delete updateRoles[role.slug];
Vue.set(state.capabilities[capabilityKey], 'roles', updateRoles)
}
if (state.role && state.role.slug && state.role.slug == role)
delete state.role.capabilities[capabilityKey]
if (state.role && state.role.slug && state.role.slug == role.slug)
state.role = role;
};
export const setRoles = (state, roles) => {