Fix for permissions change

This commit is contained in:
Hillel Coren 2016-10-28 09:42:49 +03:00
parent 7465eb1631
commit 522cabe0a1
7 changed files with 10 additions and 10 deletions

View File

@ -23,7 +23,7 @@ class AccountGatewayPolicy extends EntityPolicy
* @param User $user * @param User $user
* @return bool * @return bool
*/ */
public static function create(User $user) { public static function create(User $user, $item) {
return $user->hasPermission('admin'); return $user->hasPermission('admin');
} }
} }

View File

@ -22,7 +22,7 @@ class BankAccountPolicy extends EntityPolicy
* @param User $user * @param User $user
* @return bool * @return bool
*/ */
public static function create(User $user) { public static function create(User $user, $item) {
return $user->hasPermission('admin'); return $user->hasPermission('admin');
} }
} }

View File

@ -13,7 +13,7 @@ class DocumentPolicy extends EntityPolicy
* @param User $user * @param User $user
* @return bool * @return bool
*/ */
public static function create(User $user) public static function create(User $user, $item)
{ {
return !empty($user); return !empty($user);
} }

View File

@ -11,7 +11,7 @@ class ExpenseCategoryPolicy extends EntityPolicy
* @param User $user * @param User $user
* @return bool * @return bool
*/ */
public static function create(User $user) { public static function create(User $user, $item) {
return $user->is_admin; return $user->is_admin;
} }

View File

@ -23,7 +23,7 @@ class PaymentTermPolicy extends EntityPolicy
* @param User $user * @param User $user
* @return bool * @return bool
*/ */
public static function create(User $user) { public static function create(User $user, $item) {
return $user->hasPermission('admin'); return $user->hasPermission('admin');
} }
} }

View File

@ -9,7 +9,7 @@ class TokenPolicy extends EntityPolicy {
return $user->hasPermission('admin'); return $user->hasPermission('admin');
} }
public static function create(User $user) { public static function create(User $user, $item) {
return $user->hasPermission('admin'); return $user->hasPermission('admin');
} }
} }

View File

@ -106,7 +106,7 @@
<center> <center>
<script language="javascript"> <script language="javascript">
var iframe = document.getElementById('invoiceIFrame'); var iframe = document.getElementById('invoiceIFrame');
iframe.src = '{{ SITE_URL }}/view/' iframe.src = '{{ rtrim(SITE_URL ,'/') }}/view/'
+ window.location.search.substring(1); + window.location.search.substring(1);
&lt;/script&gt;</pre> &lt;/script&gt;</pre>
<p>{{ trans('texts.iframe_url_help2') }}</p> <p>{{ trans('texts.iframe_url_help2') }}</p>