Skip to content

Commit

Permalink
[webui][api] Get rid of WebuiProject in webui/project_controller.rb
Browse files Browse the repository at this point in the history
* Make some of the rubocop metric rules not fail
* revoke requests when projects get deleted
* Introduce set_project before_filter and use it
* Limit :require_project before filter (and hence WebuiProject) to move_path_*
  The path_elements list of repositories needs a little more thought.
  acts_as_list would be an option but that means removing the uniqe key
  in the db for partent_id and position
* Move all the support methods down in the file
* Move some of the methods into the project model
* authorize all calls that change the project
* Rename CRUD the methods
* Use strong parameters
* Concat all the stupid history_element files into one for lazy loading
* Also fix the history_elements fixtures, rake db:fixtures:load works again now...
  • Loading branch information
hennevogel committed Sep 2, 2015
1 parent d2aacc4 commit 8b4d426
Show file tree
Hide file tree
Showing 48 changed files with 1,000 additions and 964 deletions.
5 changes: 4 additions & 1 deletion src/api/.rubocop.yml
Expand Up @@ -19,7 +19,10 @@ Metrics/LineLength:
- 'db/**/*'

Metrics/ClassLength:
Severity: warning
Severity: refactor

Metrics/ModuleLength:
Severity: refactor

Style/CommandLiteral:
EnforcedStyle: percent_x
Expand Down
1 change: 0 additions & 1 deletion src/api/app/controllers/source_controller.rb
Expand Up @@ -187,7 +187,6 @@ def delete_project
path = pro.source_path
path << build_query_from_hash(params, [:user, :comment])

pro.revoke_requests
pro.destroy

Suse::Backend.delete path
Expand Down
7 changes: 4 additions & 3 deletions src/api/app/controllers/webui/package_controller.rb
Expand Up @@ -15,7 +15,8 @@ class Webui::PackageController < Webui::WebuiController

helper 'webui/comment'

before_filter :require_project, :except => [:submit_request, :devel_project]
before_filter :require_project, :except => [:submit_request, :devel_project, :users]
before_filter :set_project, :only => [:repositories, :users]
before_filter :require_package, :except => [:submit_request, :save_new_link, :save_new, :devel_project ]
# make sure it's after the require_, it requires both
before_filter :require_login, :except => [:show, :linking_packages, :show , :linking_packages , :dependency,
Expand Down Expand Up @@ -170,8 +171,8 @@ def binaries
end

def users
@users = [@project.api_obj.users, @package.users].flatten.uniq
@groups = [@project.api_obj.groups, @package.groups].flatten.uniq
@users = [@project.users, @package.users].flatten.uniq
@groups = [@project.groups, @package.groups].flatten.uniq
@roles = Role.local_roles
end

Expand Down

0 comments on commit 8b4d426

Please sign in to comment.