Code Duplication    Length = 8-8 lines in 3 locations

code/model/BuyableStockManualUpdate.php 1 location

@@ 89-96 (lines=8) @@
86
        return false;
87
    }
88
89
    protected function canDoAnything($member = null)
90
    {
91
        $shopAdminCode = EcommerceConfig::get("EcommerceRole", "admin_permission_code");
92
        if (!Permission::check($shopAdminCode)) {
93
            Security::permissionFailure($this, _t('Security.PERMFAILURE', ' This page is secured and you need administrator rights to access it. Enter your credentials below and we will send you right along.'));
94
        }
95
        return true;
96
    }
97
}
98

code/model/BuyableStockOrderEntry.php 1 location

@@ 91-98 (lines=8) @@
88
        return $this->canDoAnything();
89
    }
90
91
    protected function canDoAnything()
92
    {
93
        EcommerceConfig::get("EcommerceRole", "admin_permission_code");
94
        if (!Permission::check("ADMIN") && !Permission::check($shopAdminCode)) {
95
            Security::permissionFailure($this, _t('Security.PERMFAILURE', ' This page is secured and you need administrator rights to access it. Enter your credentials below and we will send you right along.'));
96
        }
97
        return true;
98
    }
99
100
    public function onAfterWrite()
101
    {

code/model/StockControlPing.php 1 location

@@ 258-265 (lines=8) @@
255
        return false;
256
    }
257
258
    protected function canDoAnything($member = null)
259
    {
260
        $shopAdminCode = EcommerceConfig::get("EcommerceRole", "admin_permission_code");
261
        if (!Permission::check("ADMIN") && !Permission::check($shopAdminCode)) {
262
            Security::permissionFailure($this, _t('Security.PERMFAILURE', ' This page is secured and you need administrator rights to access it. Enter your credentials below and we will send you right along.'));
263
        }
264
        return true;
265
    }
266
267
268
    public function onAfterWrite()