Class: Platform::Admin::AppsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/platform/admin/apps_controller.rb

Overview

– Copyright © 2011 Michael Berkovich

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++

Instance Method Summary collapse

Instance Method Details

#approveObject



67
68
69
70
71
72
73
74
75
76
77
# File 'app/controllers/platform/admin/apps_controller.rb', line 67

def approve
  app = Platform::Application.find(params[:app_id])
  
  app.children.each do |child|
    child.deprecate!
  end
  
  app.approve!
  
  redirect_to(:action => :view, :app_id => app.id)
end

#blockObject



50
51
52
53
54
55
56
57
58
59
# File 'app/controllers/platform/admin/apps_controller.rb', line 50

def block
  app = Platform::Application.find(params[:app_id])  
  app.block!
  
  app.children.each do |child|
    child.block!
  end
  
  redirect_to(:action => :view, :app_id => app.id)
end

#indexObject



26
27
28
# File 'app/controllers/platform/admin/apps_controller.rb', line 26

def index
  @apps = Platform::Application.filter(:params => params, :filter => Platform::ApplicationFilter)
end

#permissionsObject



42
43
44
# File 'app/controllers/platform/admin/apps_controller.rb', line 42

def permissions
  @permissions = Platform::ApplicationPermission.filter(:params => params, :filter => Platform::ApplicationPermissionFilter)
end

#ratingsObject



46
47
48
# File 'app/controllers/platform/admin/apps_controller.rb', line 46

def ratings
  @ratings = Platform::Rating.filter(:params => params, :filter => Platform::RatingFilter)
end

#rejectObject



79
80
81
82
83
# File 'app/controllers/platform/admin/apps_controller.rb', line 79

def reject
  app = Platform::Application.find(params[:app_id])  
  app.reject!
  redirect_to(:action => :view, :app_id => app.id)
end

#remove_permissionObject



92
93
94
95
96
97
# File 'app/controllers/platform/admin/apps_controller.rb', line 92

def remove_permission
  app = Platform::Application.find(params[:app_id])  
  app.set_permission(params[:perm], false)
  app.save
  redirect_to(:action => :view, :app_id => app.id)
end

#set_permissionObject



85
86
87
88
89
90
# File 'app/controllers/platform/admin/apps_controller.rb', line 85

def set_permission
  app = Platform::Application.find(params[:app_id])  
  app.set_permission(params[:perm], true)
  app.save
  redirect_to(:action => :view, :app_id => app.id)
end

#tokensObject



34
35
36
# File 'app/controllers/platform/admin/apps_controller.rb', line 34

def tokens
  @tokens = Platform::Oauth::OauthToken.filter(:params => params, :filter => Platform::Oauth::OauthTokenFilter)
end

#unblockObject



61
62
63
64
65
# File 'app/controllers/platform/admin/apps_controller.rb', line 61

def unblock
  app = Platform::Application.find(params[:app_id])  
  app.unblock!
  redirect_to(:action => :view, :app_id => app.id)
end

#usersObject



38
39
40
# File 'app/controllers/platform/admin/apps_controller.rb', line 38

def users
  @users = Platform::ApplicationUser.filter(:params => params, :filter => Platform::ApplicationUserFilter)
end

#viewObject



30
31
32
# File 'app/controllers/platform/admin/apps_controller.rb', line 30

def view
  @app = Platform::Application.find(params[:app_id])
end