/** * Register any application authentication / authorization services. * * @param \Illuminate\Contracts\Auth\Access\Gate $gate * @return void */ public function boot(GateContract $gate) { parent::registerPolicies($gate); // Dynamically register permissions with Laravel's Gate. if (get_sparkplug_config('ACL')) { $this->registerGatePermissions($gate); } }
/** * Create a new controller instance. * @internal param ReflectionClass $reflect */ public function __construct() { if (get_sparkplug_config('ACL')) { if (Gate::denies(get_module_class_name($this))) { abort('403', 'User has no privilages to access this page'); } } }
/** * Execute the console command. * @return mixed * @internal param Application $app */ public function handle() { if (strtolower($this->argument('switch')) == "on") { $switch = true; } else { if (strtolower($this->argument('switch')) == "off") { $switch = false; } } if (!(IntVal($switch) == IntVal(get_sparkplug_config('ACL')))) { $CONFIG['config']['ACL'] = $switch; set_sparkplug_config_value($CONFIG); } }