referral settings, logs, locations permissions
This commit is contained in:
parent
a04e29c4c9
commit
170fe07417
@ -29,6 +29,14 @@ class Controller_api_siteconfig extends Crunchbutton_Controller_RestAccount {
|
||||
case 'support-phone-afterhours':
|
||||
$hasPermisstion = c::admin()->permission()->check( [ 'global', 'support-all', 'support-settings' ] );
|
||||
break;
|
||||
case 'referral-inviter-credit-value':
|
||||
case 'referral-invited-credit-value':
|
||||
case 'referral-add-credit-to-invited':
|
||||
case 'referral-limit-per-code':
|
||||
case 'referral-is-enable':
|
||||
case 'referral-invites-limit-per-code':
|
||||
$hasPermisstion = c::admin()->permission()->check( [ 'global', 'invite-promo' ] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
class Controller_loc extends Crunchbutton_Controller_Account {
|
||||
public function init() {
|
||||
|
||||
if (!c::admin()->permission()->check(['global'])) {
|
||||
if (!c::admin()->permission()->check([ 'global','locations'])) {
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
class Controller_logs_content extends Crunchbutton_Controller_Account {
|
||||
public function init() {
|
||||
|
||||
if (!c::admin()->permission()->check(['global'])) {
|
||||
if (!c::admin()->permission()->check(['global','logs'])) {
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
class Controller_logs extends Crunchbutton_Controller_Account {
|
||||
public function init() {
|
||||
// @permission
|
||||
if (!c::admin()->permission()->check(['global'])) {
|
||||
if (!c::admin()->permission()->check(['global','logs'])) {
|
||||
return ;
|
||||
}
|
||||
c::view()->display('logs/index');
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
class Controller_referral extends Crunchbutton_Controller_Account {
|
||||
public function init() {
|
||||
if (!c::admin()->permission()->check(['global'])) {
|
||||
if (!c::admin()->permission()->check(['global','invite-promo'])) {
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
@ -8,6 +8,10 @@ class Controller_api_referral extends Crunchbutton_Controller_Rest {
|
||||
case 'save':
|
||||
if ( $_SESSION['admin'] && $this->method() == 'post' ) {
|
||||
|
||||
if( !c::admin()->permission()->check( [ 'global', 'invite-promo' ] ) ){
|
||||
return;
|
||||
}
|
||||
|
||||
Crunchbutton_Config::store( Crunchbutton_Referral::KEY_IS_REFERRAL_ENABLE, $this->request()['enabled'] );
|
||||
Crunchbutton_Config::store( Crunchbutton_Referral::KEY_INVITER_CREDIT_VALUE, $this->request()['inviter_credit'] );
|
||||
Crunchbutton_Config::store( Crunchbutton_Referral::KEY_INVITED_CREDIT_VALUE, $this->request()['invited_credit'] );
|
||||
|
||||
@ -201,7 +201,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if ( c::admin()->permission()->check( [ 'global'] ) ) { ?>
|
||||
<?php if ( c::admin()->permission()->check( [ 'global','locations'] ) ) { ?>
|
||||
<li class="<?=$this->page == 'loc' ? 'active' : ''?>">
|
||||
<span class="glow"></span>
|
||||
<a href="/loc">
|
||||
@ -210,7 +210,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if ( c::admin()->permission()->check( [ 'global'] ) ) { ?>
|
||||
<?php if ( c::admin()->permission()->check( [ 'global','logs'] ) ) { ?>
|
||||
<li class="<?=$this->page == 'logs' ? 'active' : ''?>">
|
||||
<span class="glow"></span>
|
||||
<a href="/logs">
|
||||
@ -219,7 +219,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if ( c::admin()->permission()->check( [ 'global'] ) ) { ?>
|
||||
<?php if ( c::admin()->permission()->check( [ 'global','invite-promo'] ) ) { ?>
|
||||
<li class="<?=$this->page == 'referral' ? 'active' : ''?>">
|
||||
<span class="glow"></span>
|
||||
<a href="/referral">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user