Sha256: 7cb8ae62128bc7743917a726da060a9c2e72fc2f056c6ef51900433bad7004ea
Contents?: true
Size: 495 Bytes
Versions: 3
Compression:
Stored size: 495 Bytes
Contents
class WebAdmin::UsersController < WebAdmin::CrudController def new super current_user.permissions.where(["permission_type <> ?", WebAdmin::PermissionType::DENY]).each do |permission| @object.permissions.build(model: permission.model, permission_type: permission.permission_type) end end protected def permitted_params params.require(:user).permit(:id, :email, :password, :password_confirmation, permissions_attributes: [:id, :permission_type, :model]) end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
web_admin-0.1.0 | app/controllers/web_admin/users_controller.rb |
web_admin-0.0.2 | app/controllers/web_admin/users_controller.rb |
web_admin-0.0.1 | app/controllers/web_admin/users_controller.rb |