Class EnvironmentRoleManagerController
In: app/controllers/admin/environment_role_manager_controller.rb
Parent: AdminController

Methods

Public Instance methods

[Source]

    # File app/controllers/admin/environment_role_manager_controller.rb, line 30
30:   def add_role
31:     @person = Person.find(params[:person])
32:     @role = Role.find(params[:role])
33:     if environment.affiliate(@person, @role)
34:       redirect_to :action => 'index'
35:     else
36:       @admin = Person.find(params[:person])
37:       @roles = Role.find(:all).select{ |r| r.has_kind?(:environment) }
38:       render :action => 'affiliate'
39:     end
40:   end

[Source]

    # File app/controllers/admin/environment_role_manager_controller.rb, line 24
24:   def change_role
25:     @roles = Role.find(:all).select{ |r| r.has_kind?(:environment) }
26:     @admin = Person.find(params[:id])
27:     @associations = @admin.find_roles(environment)
28:   end

[Source]

    # File app/controllers/admin/environment_role_manager_controller.rb, line 8
 8:   def change_roles
 9:     @admin = Person.find(params[:id])
10:     @roles = Role.find(:all).select{ |r| r.has_kind?(:environment) }
11:   end

[Source]

   # File app/controllers/admin/environment_role_manager_controller.rb, line 4
4:   def index
5:     @admins = Person.find(:all, :conditions => ['role_assignments.resource_type = ?', 'Environment'], :include => :role_assignments )
6:   end

[Source]

    # File app/controllers/admin/environment_role_manager_controller.rb, line 62
62:   def make_admin
63:     @people = Person.find(:all)
64:     @roles = Role.find(:all).select{|r|r.has_kind?(:environment)}
65:   end

[Source]

    # File app/controllers/admin/environment_role_manager_controller.rb, line 42
42:   def remove_role
43:     @association = RoleAssignment.find(params[:id])
44:     if @association.destroy
45:       flash[:notice] = _('Member succefully unassociated')
46:     else
47:       flash[:notice] = _('Failed to unassociate member')
48:     end
49:     redirect_to :aciton => 'index'
50:   end

[Source]

    # File app/controllers/admin/environment_role_manager_controller.rb, line 52
52:   def unassociate
53:     @association = RoleAssignment.find(params[:id])
54:     if @association.destroy
55:       flash[:notice] = _('Member succefully unassociated')
56:     else
57:       flash[:notice] = _('Failed to unassociate member')
58:     end
59:     redirect_to :aciton => 'index'
60:   end

[Source]

    # File app/controllers/admin/environment_role_manager_controller.rb, line 13
13:   def update_roles
14:     @roles = params[:roles] ? Role.find(params[:roles]) : []
15:     @person = Person.find(params[:person])
16:     if @person.define_roles(@roles, environment)
17:       flash[:notice] = _('Roles successfuly updated')
18:     else
19:       flash[:notice] = _('Couldn\'t change the roles')
20:     end
21:     redirect_to :action => :index
22:   end

[Validate]