Sha256: 15396d4c49fc6896d4b2b2061b9c312d29a7a3ff357790c8536d339be1e80b40
Contents?: true
Size: 689 Bytes
Versions: 19
Compression:
Stored size: 689 Bytes
Contents
class ReviewDiscoveryPermissions < ActiveRecord::Migration def up if (mgr = Role.find_by_name("Discovery Manager")) perms = [] perms << "submit_discovered_hosts" if Permission.find_by_name("edit_discovered_hosts") perms << "auto_provision_discovered_hosts" if Permission.find_by_name("provision_discovered_hosts") perms << "create_discovery_rules" if Permission.find_by_name("new_discovery_rules") perms << "destroy_discovery_rules" if Permission.find_by_name("delete_discovery_rules") mgr.add_permissions!(perms) end Permission.find_by_name("new_discovery_rules").try(:destroy) end def down # rollback is not supported end end
Version data entries
19 entries across 19 versions & 1 rubygems