demo user not available edit profile

This commit is contained in:
Zoker 2017-08-07 21:20:31 +08:00
parent aa56498601
commit 616fbfdeba
1 changed files with 5 additions and 0 deletions

View File

@ -4,6 +4,11 @@ class RegistrationsController < Devise::RegistrationsController
before_action :config_permitted_parameters
def edit
return redirect_to root_path, alert: '当前用户不允许修改账户信息!' if current_user.ident == 'demo'
super
end
private
def config_permitted_parameters