add nova
This commit is contained in:
1 parent
76d18365a5
commit
061f09eca1
1597 files changed
+109451
-1
No files matched your search
@@ -0,0 +1,40 @@
|
||||
import find from 'lodash/find'
|
||||
|
||||
export default {
|
||||
computed: {
|
||||
/**
|
||||
* Get the resource information object for the current resource.
|
||||
*/
|
||||
resourceInformation() {
|
||||
return find(Nova.config('resources'), resource => {
|
||||
return resource.uriKey === this.resourceName
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Get the resource information object for the current resource.
|
||||
*/
|
||||
viaResourceInformation() {
|
||||
if (!this.viaResource) {
|
||||
return
|
||||
}
|
||||
|
||||
return find(Nova.config('resources'), resource => {
|
||||
return resource.uriKey === this.viaResource
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to create the current resource.
|
||||
*/
|
||||
authorizedToCreate() {
|
||||
if (
|
||||
['hasOneThrough', 'hasManyThrough'].indexOf(this.relationshipType) >= 0
|
||||
) {
|
||||
return false
|
||||
}
|
||||
|
||||
return this.resourceInformation?.authorizedToCreate || false
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in new issue
Block a user