Class: NetzplanMicroFrontend::Generators::InstallUserRightsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/netzplan_micro_frontend/install_user_rights/install_user_rights_generator.rb

Instance Method Summary collapse

Instance Method Details

#public_micro_frontend_sourcesObject



8
9
10
11
12
13
14
15
16
# File 'lib/generators/netzplan_micro_frontend/install_user_rights/install_user_rights_generator.rb', line 8

def public_micro_frontend_sources
  inject_into_file 'app/models/ability.rb', after: "def initialize(user)\n" do
"    can :read, :micro_frontend_sources\n    can :manage, :micro_frontend\n\n"
  end
end

#routesObject



4
5
6
# File 'lib/generators/netzplan_micro_frontend/install_user_rights/install_user_rights_generator.rb', line 4

def routes
  route "use_netzplan_microfrontend"
end