mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 12:17:08 +00:00
Adapt the access rights mixin to new user management code
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { mapGetters } from 'vuex';
|
||||
import access from '@/lib/organisations/access';
|
||||
import { Organisations } from '@dougal/organisations';
|
||||
|
||||
export default {
|
||||
name: "AccessMixin",
|
||||
@@ -10,10 +10,14 @@ export default {
|
||||
|
||||
methods: {
|
||||
|
||||
access (operation, item) {
|
||||
if (!item) item = this.projectConfiguration;
|
||||
|
||||
return access(this.user?.organisations ?? {}, item?.organisations ?? {}, operation);
|
||||
access (operation, organisations) {
|
||||
if (this.user) {
|
||||
if (!organisations) organisations = this.projectConfiguration?.organisations;
|
||||
if (!organisations instanceof Organisations) {
|
||||
organisations = new Organisations(organisations);
|
||||
}
|
||||
return this.user.canDo(operation, organisations);
|
||||
}
|
||||
},
|
||||
|
||||
readaccess (item) {
|
||||
|
||||
Reference in New Issue
Block a user