3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-03-29 11:56:19 +00:00

Allow certain users to override 2FA with permission

This commit is contained in:
snipe
2016-10-31 16:52:25 -07:00
parent e065d18227
commit cbfcf959f9
9 changed files with 63 additions and 10 deletions

View File

@ -9,6 +9,7 @@ use View;
use Auth;
use App\Helpers\Helper;
use App\Models\Setting;
use Gate;
/**
* This controller handles all actions related to User Profiles for
@ -54,7 +55,8 @@ class ProfileController extends Controller
$user->gravatar = e(Input::get('gravatar'));
$user->locale = e(Input::get('locale'));
if ((Setting::getSettings()->two_factor_enabled=='1') && (!config('app.lock_passwords'))) {
if ((Gate::allows('self.two_factor')) && ((Setting::getSettings()->two_factor_enabled=='1') && (!config('app.lock_passwords')))) {
$user->two_factor_optin = e(Input::get('two_factor_optin', '0'));
}