Class: Goldberg::RolesPermissionsController
Instance Method Summary
collapse
Methods included from Controller
included
#copy, #six_local_auto_login
#active_scaffold_render_secure_download, #assign_names_with_active_scaffold, #render_with_active_scaffold, #search_generic_view_paths?
Instance Method Details
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/controllers/goldberg/roles_permissions_controller.rb', line 33
def create
@roles_permission = RolesPermission.new(params[:roles_permission])
if @roles_permission.save
flash[:notice] = 'RolesPermission was successfully created.'
redirect_to :controller => 'roles', :action => 'show',
:id => @roles_permission.role_id
else
render :action => 'new'
end
end
|
58
59
60
61
62
63
|
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/controllers/goldberg/roles_permissions_controller.rb', line 58
def destroy
rp = RolesPermission.find(params[:id])
role = rp.role_id
rp.destroy
redirect_to :controller => 'roles', :action => 'show', :id => role
end
|
44
45
46
|
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/controllers/goldberg/roles_permissions_controller.rb', line 44
def edit
@roles_permission = RolesPermission.find(params[:id])
end
|
9
10
11
12
|
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/controllers/goldberg/roles_permissions_controller.rb', line 9
def index
list
render :action => 'list'
end
|
14
15
16
|
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/controllers/goldberg/roles_permissions_controller.rb', line 14
def list
@roles_permissions = RolesPermission.find(:all)
end
|
22
23
24
|
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/controllers/goldberg/roles_permissions_controller.rb', line 22
def new
@roles_permission = RolesPermission.new
end
|
#new_permission_for_role ⇒ Object
26
27
28
29
30
31
|
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/controllers/goldberg/roles_permissions_controller.rb', line 26
def new_permission_for_role
@roles_permission = RolesPermission.new
@roles_permission.role_id = params[:id]
@role = Role.find(params[:id])
@permissions = Permission.find_not_for_role(params[:id])
end
|
18
19
20
|
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/controllers/goldberg/roles_permissions_controller.rb', line 18
def show
@roles_permission = RolesPermission.find(params[:id])
end
|
48
49
50
51
52
53
54
55
56
|
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/controllers/goldberg/roles_permissions_controller.rb', line 48
def update
@roles_permission = RolesPermission.find(params[:id])
if @roles_permission.update_attributes(params[:roles_permission])
flash[:notice] = 'RolesPermission was successfully updated.'
redirect_to :action => 'show', :id => @roles_permission
else
render :action => 'edit'
end
end
|