OK, so since hobo doesn't come with roles, I've been working on implementing
role-based permissions, and have run up against something odd when I apply
them to the update permissions for a given model.
Here's the model code:
def update_permitted?
acting_user.administrator? or
acting_user.roles.joins(:role_models).where(:role_models => {:model_name =>
"site", :can_update => true}).length > 0
end
now this join query, and the comparison to 0 work as expected in the rails
console, and the view permissions in the same model seem to work. I can even
update the model from the ajaxy fields on the view page, but when I try the
edit page I get this error on the server console, and a blank page in my
browser:
[2011-04-13 11:04:43] ERROR Errno::ENOMEM: Not enough space
C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/rack/log_tailer.rb:25:in
`write'
C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/rack/log_tailer.rb:25:in
`print'
C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/rack/log_tailer.rb:25:in
`tail!'
C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/rack/log_tailer.rb:15:in
`call'
C:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/content_length.rb:13:in
`call'
C:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/handler/webrick.rb:52:in
`service'
C:/Ruby187/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
C:/Ruby187/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
C:/Ruby187/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
C:/Ruby187/lib/ruby/1.8/webrick/server.rb:162:in `start'
C:/Ruby187/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
C:/Ruby187/lib/ruby/1.8/webrick/server.rb:95:in `start'
C:/Ruby187/lib/ruby/1.8/webrick/server.rb:92:in `each'
C:/Ruby187/lib/ruby/1.8/webrick/server.rb:92:in `start'
C:/Ruby187/lib/ruby/1.8/webrick/server.rb:23:in `start'
C:/Ruby187/lib/ruby/1.8/webrick/server.rb:82:in `start'
C:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/handler/webrick.rb:13:in
`run'
C:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/server.rb:213:in
`start'
C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/commands/server.rb:65:in
`start'
C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:30
C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:27:in
`tap'
C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:27
script/rails:6:in `require'
script/rails:6
now that to me looks completely unrelated to hobo permissions, but if I set
the update perms to "true" instead of using my role query, it does just
fine. It almost looks like some kind of infinite loop is happening, since I
sure have enough disk space, but since the query works in the console, I
have no clue what's going on here...
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en.