Commit 045d87b648c11d4a7b2a47c3644316be1f990ee5
1 parent
acc5ddcb
Exists in
master
and in
28 other branches
ActionItem19: updating script anhetegua
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@927 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
1 changed file
with
6 additions
and
0 deletions
Show diff stats
script/anhetegua
@@ -48,20 +48,26 @@ new_validator(df, 'Forum Brasileiro de Economia Solidaria', 'fbes') | @@ -48,20 +48,26 @@ new_validator(df, 'Forum Brasileiro de Economia Solidaria', 'fbes') | ||
48 | new_validator(rs, 'Associacao Software Livre.Org', 'asl') | 48 | new_validator(rs, 'Associacao Software Livre.Org', 'asl') |
49 | new_validator(rs, 'Forum Gaucho de Economia Solidaria', 'ecosolrs') | 49 | new_validator(rs, 'Forum Gaucho de Economia Solidaria', 'ecosolrs') |
50 | 50 | ||
51 | +Profile.destroy_all | ||
51 | # Profile for exibition of homepage and creations of sytem articles such as about and accessibility | 52 | # Profile for exibition of homepage and creations of sytem articles such as about and accessibility |
52 | noosfero = Profile.create!(:name => 'noosfero', :identifier => 'noosfero') | 53 | noosfero = Profile.create!(:name => 'noosfero', :identifier => 'noosfero') |
53 | 54 | ||
55 | +Role.destroy_all | ||
54 | # Role for own things | 56 | # Role for own things |
55 | owner_role = Role.create!(:name => 'owner', :permissions => ['edit_profile', 'destroy_profile', 'manage_memberships', 'post_content', 'edit_profile_design']) | 57 | owner_role = Role.create!(:name => 'owner', :permissions => ['edit_profile', 'destroy_profile', 'manage_memberships', 'post_content', 'edit_profile_design']) |
56 | 58 | ||
57 | # root user of the system, admin_role for him, the assignment of the role for him and the ownership of the system homepage | 59 | # root user of the system, admin_role for him, the assignment of the role for him and the ownership of the system homepage |
60 | +User.destroy_all | ||
58 | root = User.create!(:login => 'root', :email => 'root@noosfero.org', :password => 'root', :password_confirmation => 'root').person | 61 | root = User.create!(:login => 'root', :email => 'root@noosfero.org', :password => 'root', :password_confirmation => 'root').person |
59 | admin_role = Role.create!(:name => 'admin', :permissions => ['view_environment_admin_panel','edit_environment_features', 'edit_environment_design', 'manage_environment_categories', 'manage_environment_roles', 'manage_environment_validators']) | 62 | admin_role = Role.create!(:name => 'admin', :permissions => ['view_environment_admin_panel','edit_environment_features', 'edit_environment_design', 'manage_environment_categories', 'manage_environment_roles', 'manage_environment_validators']) |
63 | + | ||
64 | +RoleAssignment.destroy_all | ||
60 | RoleAssignment.create!(:accessor => root, :role => admin_role, :resource => Environment.default) | 65 | RoleAssignment.create!(:accessor => root, :role => admin_role, :resource => Environment.default) |
61 | RoleAssignment.create!(:accessor => root, :role => owner_role, :resource => noosfero) | 66 | RoleAssignment.create!(:accessor => root, :role => owner_role, :resource => noosfero) |
62 | 67 | ||
63 | # Sample user and sample enterprise owned by him | 68 | # Sample user and sample enterprise owned by him |
64 | ze= User.create!(:login => 'ze', :email => 'ze@localhost.localdomain', :password => 'test', :password_confirmation => 'test').person | 69 | ze= User.create!(:login => 'ze', :email => 'ze@localhost.localdomain', :password => 'test', :password_confirmation => 'test').person |
70 | +Enterprise.destroy_all | ||
65 | empa = Enterprise.create!(:name => 'Empreendimento A', :identifier => 'empreendimento_a') | 71 | empa = Enterprise.create!(:name => 'Empreendimento A', :identifier => 'empreendimento_a') |
66 | RoleAssignment.create!(:accessor => ze, :role => owner_role, :resource => empa) | 72 | RoleAssignment.create!(:accessor => ze, :role => owner_role, :resource => empa) |
67 | 73 |