1 class Arvados::V1::RepositoriesController < ApplicationController
2 before_filter :admin_required, :only => :get_all_permissions
3 def get_all_permissions
5 User.includes(:authorized_keys).all.each do |u|
10 @repos = Repository.includes(:permissions).all
12 gitolite_permissions = ''
13 repo.permissions.each do |perm|
14 user_uuid = perm.tail_uuid
15 @user_aks[user_uuid] = @users[user_uuid].andand.authorized_keys.collect do |ak|
17 public_key: ak.public_key,
18 authorized_key_uuid: ak.uuid
21 if @user_aks[user_uuid].any?
22 @repo_info[repo.uuid] ||= {
25 push_url: repo.push_url,
26 fetch_url: repo.fetch_url,
29 @repo_info[repo.uuid][:user_permissions][user_uuid] ||= {}
30 @repo_info[repo.uuid][:user_permissions][user_uuid][perm.name] = true
34 @repo_info.values.each do |repo_users|
35 repo_users[:user_permissions].each do |user_uuid,perms|
37 perms[:gitolite_permissions] = 'RW'
38 perms['can_read'] = true
39 elsif perms['can_read']
40 perms[:gitolite_permissions] = 'R'
45 kind: 'arvados#RepositoryPermissionSnapshot',
46 repositories: @repo_info.values,