Mailinglist Archive: opensuse-buildservice (258 mails)

< Previous Next >
[opensuse-buildservice] Re: [PATCH] [api] correct default permissions for roles maintainer, reader, downloader to be in line with ACL
  • From: Adrian Schröter <adrian@xxxxxxx>
  • Date: Thu, 12 Aug 2010 17:05:19 +0200
  • Message-id: <201008121705.20659.adrian@xxxxxxx>

That breaks my permanent running test suite runner here:

# RAILS_ENV=test rake db:migrate --trace
(in /abuild/obs-git/build-service/src/api)
DEPRECATION WARNING: Rake tasks in vendor/plugins/mdd/tasks are deprecated. Use
lib/tasks instead. (called from
/usr/lib64/ruby/gems/1.8/gems/rails-2.3.8/lib/tasks/rails.rb:10)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
== FixAclPermissions: migrating ==============================================
rake aborted!
An error has occurred, all later migrations canceled:

Mysql::Error: Duplicate entry '12-3' for key
'roles_static_permissions_all_index': INSERT INTO `roles_static_permissions`
(`created_at`, `static_permission_id`, `role_id`) VALUES ('2010-08-12
16:49:15', 12, 3)
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract_adapter.rb:221:in
`log'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/mysql_adapter.rb:323:in
`execute'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/database_statements.rb:259:in
`insert_sql'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/mysql_adapter.rb:333:in
`insert_sql'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/database_statements.rb:44:in
`insert_without_query_dirty'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/query_cache.rb:19:in
`insert'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/associations/has_and_belongs_to_many_association.rb:78:in
`insert_record'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/associations/association_collection.rb:119:in
`<<'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/associations/association_collection.rb:412:in
`add_record_to_target_with_callbacks'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/associations/association_collection.rb:118:in
`<<'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/associations/association_collection.rb:116:in
`each'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/associations/association_collection.rb:116:in
`<<'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/associations/association_collection.rb:141:in
`transaction'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in
`transaction'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/transactions.rb:182:in
`transaction'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/associations/association_collection.rb:140:in
`transaction'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/associations/association_collection.rb:115:in
`<<'
./db/migrate//20100812100000_fix_acl_permissions.rb:9:in `up_without_benchmarks'
./db/migrate//20100812100000_fix_acl_permissions.rb:8:in `each'
./db/migrate//20100812100000_fix_acl_permissions.rb:8:in `up_without_benchmarks'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:282:in
`send'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:282:in
`migrate'
/usr/lib64/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:282:in
`migrate'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:365:in
`__send__'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:365:in
`migrate'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:491
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:567:in
`call'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:567:in
`ddl_transaction'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:490:in
`migrate'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:477:in
`each'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:477:in
`migrate'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:401:in
`up'
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:383:in
`migrate'
/usr/lib64/ruby/gems/1.8/gems/rails-2.3.8/lib/tasks/databases.rake:112
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
`invoke_with_call_chain'
/usr/lib64/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with_call_chain'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_exception_handling'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_exception_handling'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19



On Thursday 12 August 2010 16:47:53 OBS build-service wrote:
From: Martin Mohring <martinmohring@xxxxxxxxxxxxxxxxxxx>

---
.../migrate/20100812100000_fix_acl_permissions.rb | 25
++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
create mode 100644 src/api/db/migrate/20100812100000_fix_acl_permissions.rb

diff --git a/src/api/db/migrate/20100812100000_fix_acl_permissions.rb
b/src/api/db/migrate/20100812100000_fix_acl_permissions.rb
new file mode 100644
index 0000000..b5b9dbe
--- /dev/null
+++ b/src/api/db/migrate/20100812100000_fix_acl_permissions.rb
@@ -0,0 +1,25 @@
+class FixAclPermissions < ActiveRecord::Migration
+ def self.up
+ reader = Role.find_by_title 'reader'
+ maintainer = Role.find_by_title 'maintainer'
+ downloader = Role.find_by_title 'downloader'
+
+ sourceperm = StaticPermission.find_by_title('source_access')
+ [maintainer,reader].each do |role|
+ role.static_permissions << sourceperm
+ end
+
+ privperm = StaticPermission.find_by_title('private_view')
+ [maintainer,reader,downloader].each do |role|
+ role.static_permissions << privperm
+ end
+
+ downloadperm = StaticPermission.find_by_title('download_binaries')
+ [maintainer,downloader].each do |role|
+ role.static_permissions << downloadperm
+ end
+ end
+
+ def self.down
+ end
+end


--
Adrian Schroeter
SUSE Linux Products GmbH
email: adrian@xxxxxxx
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages