Skip to content

Commit

Permalink
[webui] merge Webui::Role into Role
Browse files Browse the repository at this point in the history
It was just a namespace anyway
  • Loading branch information
coolo committed Oct 22, 2013
1 parent 1c50011 commit 51b644c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 20 deletions.
6 changes: 6 additions & 0 deletions src/api/app/models/role.rb
Expand Up @@ -58,6 +58,12 @@ def rolecache
def get_by_title(title)
find_by_title(title) or raise NotFound.new("Couldn't find Role '#{title}'")
end
def local_roles
Array[ "maintainer", "bugowner", "reviewer", "downloader" , "reader"]
end
def global_roles
Array[ "Admin", "User"]
end
end

def rolecache
Expand Down
2 changes: 1 addition & 1 deletion src/api/webui/app/controllers/webui/group_controller.rb
Expand Up @@ -28,7 +28,7 @@ def add

def edit
required_parameters :group
@roles = Webui::Role.global_roles
@roles = Role.global_roles
@members = []
@displayed_group.person.each do |person |
user = { 'name' => person.userid }
Expand Down
6 changes: 3 additions & 3 deletions src/api/webui/app/controllers/webui/package_controller.rb
Expand Up @@ -174,7 +174,7 @@ def binaries
def users
@users = [@project.users, @package.users].flatten.uniq
@groups = [@project.groups, @package.groups].flatten.uniq
@roles = Webui::Role.local_roles
@roles = Role.local_roles
end

def requests
Expand Down Expand Up @@ -301,11 +301,11 @@ def set_file_details
private :set_file_details

def add_person
@roles = Webui::Role.local_roles
@roles = Role.local_roles
end

def add_group
@roles = Webui::Role.local_roles
@roles = Role.local_roles
end

def rdiff
Expand Down
2 changes: 1 addition & 1 deletion src/api/webui/app/controllers/webui/project_controller.rb
Expand Up @@ -119,7 +119,7 @@ def get_filtered_projectlist(filterstring, excludefilter='', opts={})
def users
@users = @project.users
@groups = @project.groups
@roles = Webui::Role.local_roles
@roles = Role.local_roles
end

def subprojects
Expand Down
4 changes: 2 additions & 2 deletions src/api/webui/app/controllers/webui/user_controller.rb
Expand Up @@ -72,7 +72,7 @@ def save
end

def edit
@roles = Webui::Role.global_roles
@roles = Role.global_roles
@states = State.states
end

Expand Down Expand Up @@ -113,7 +113,7 @@ def admin
end

def save_dialog
@roles = Webui::Role.global_roles
@roles = Role.global_roles
render_dialog
end

Expand Down
13 changes: 0 additions & 13 deletions src/api/webui/app/models/webui/role.rb

This file was deleted.

0 comments on commit 51b644c

Please sign in to comment.