diff --git a/.idea/composerJson.xml b/.idea/composerJson.xml new file mode 100644 index 0000000..1b07430 --- /dev/null +++ b/.idea/composerJson.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/resources/js/Global/policy/can.js b/resources/js/Global/policy/can.js index 464f6cd..33ac344 100644 --- a/resources/js/Global/policy/can.js +++ b/resources/js/Global/policy/can.js @@ -2,20 +2,21 @@ import policyClasses from '@Global/policy'; import { UserService } from "@Global/services/storage.services"; import globalStore from "@Global/store"; import authStore from "@Core/store"; - +import Routes from "@Global/utils/common/routes" + export default (model, object, module = null) => { //Access To All Place For Site Manager let siteOwner = UserService.get().is_owner == "true"; - if (siteOwner) { + if (siteOwner || window.location.hostname === Routes.originHostName()) { return true; } - + let policyClass = model.split('::')[0] + 'Policy'; let policymethod = model.split('::')[1]; module = module ? module : globalStore.state.common.current_module; let rootPermissions = authStore.state.auth.permissions; let permissions = rootPermissions[module] ? Object.values(rootPermissions[module]) : [] ; - + //instance policty class let policy = new policyClasses[policyClass]; if (typeof policy == 'object' && typeof policy[policymethod] == 'function' ) { @@ -23,4 +24,4 @@ export default (model, object, module = null) => { } else { return false; } -}; \ No newline at end of file +};