Hi there, I''ve just installed login_engine and user_engine from the repositories, followed the setup procedures as documented in: vendor/plugins/user_engine/README But I''m getting the following failure: vince@vaio:~/Projects/Booking$ rake bootstrap (in /home/vince/Projects/Booking) rake aborted! undefined method `edit'' for class `UserController'' I''ve commented out the following: # We need to wrap around the old edit # alias :old_edit :edit # def edit # @all_roles = Role.find_all.select { |r| r.name !# UserEngine.config(:guest_role_name) } # old_edit # end (vendor/plugins/user_engine/app/controllers/user_controller.rb) It appears to have worked correctly and created the the default roles. Is this just depreciated code/bug, or will i run into problems later on? Cheers, -v -- keys: http://codex.net/gpg.asc You can never plan the future by the past. -- Edmund Burke
Hi Vincent, edit following file: $RAILS_ROOT/vendor/plugins/user_engine/app/models/permission.rb In method synchronize_with_controllers find lines that say: # we need to load all the controllers... controller_files.each do |file_name| and add a sort call in the second one: # we need to load all the controllers... controller_files.sort.each do |file_name| Remove comments from the UserController and everything should work fine. There is a dependency between UserEngine and LoginEngine which is not taken into account while loading controllers. It is just a quick hack but works for now. It would be nice to have some way of specyfying dependencies between engines... On the other side it might unnecessary complicate things. Something to think about later ;) Regards, Bragi On 09/12/05, Vincent AE Scott <rails-e7je8kD1+OBeoWH0uzbU5w@public.gmane.org> wrote:> > Hi there, > I''ve just installed login_engine and user_engine from the repositories, > followed the setup procedures as documented in: > vendor/plugins/user_engine/README > > But I''m getting the following failure: > > vince@vaio:~/Projects/Booking$ rake bootstrap > (in /home/vince/Projects/Booking) > rake aborted! > undefined method `edit'' for class `UserController'' > > > I''ve commented out the following: > > # We need to wrap around the old edit > # alias :old_edit :edit > # def edit > # @all_roles = Role.find_all.select { |r| r.name !> # UserEngine.config(:guest_role_name) } > # old_edit > # end > > (vendor/plugins/user_engine/app/controllers/user_controller.rb) > > It appears to have worked correctly and created the the default roles. > > Is this just depreciated code/bug, or will i run into problems later on? > > Cheers, > -v > > -- > keys: http://codex.net/gpg.asc > > You can never plan the future by the past. > -- Edmund Burke > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Bragi Ragnarson _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Never use alias or alias_method in classes that potentially can be reloaded in the development mode. That includes controllers, models, helpers, etc. The first call to alias works fine, but the second one fails just like in your case. Kent. On Friday 09 December 2005 12:18, Vincent AE Scott wrote:> Hi there, > I''ve just installed login_engine and user_engine from the repositories, > followed the setup procedures as documented in: > vendor/plugins/user_engine/README > > But I''m getting the following failure: > > vince@vaio:~/Projects/Booking$ rake bootstrap > (in /home/vince/Projects/Booking) > rake aborted! > undefined method `edit'' for class `UserController'' > > > I''ve commented out the following: > > # We need to wrap around the old edit > # alias :old_edit :edit > # def edit > # @all_roles = Role.find_all.select { |r| r.name !> # UserEngine.config(:guest_role_name) } > # old_edit > # end > > (vendor/plugins/user_engine/app/controllers/user_controller.rb) > > It appears to have worked correctly and created the the default roles. > > Is this just depreciated code/bug, or will i run into problems later on? > > Cheers, > -v
Excellent, that worked fine, cheers. but now I''ve encountered another problem, attempting to navigate to the /user page fails to prompt with a login screen. The browsers (galeon/firefox) are reporting "redirected too many times". I have stopped WEBrick, deleted the sessions, removed the cookies and started over, but its still doing it. #if bragi.ragnarson /* Dec 09, 06:36 */> > Hi Vincent, > edit following file: > $RAILS_ROOT/vendor/plugins/user_engine/app/models/permission.rb > In method synchronize_with_controllers find lines that say: > # we need to load all the controllers... > controller_files.each do |file_name| > and add a sort call in the second one: > # we need to load all the controllers... > controller_files.sort.each do |file_name| > Remove comments from the UserController and everything should work > fine. > There is a dependency between UserEngine and LoginEngine which is not > taken into account while loading controllers. It is just a quick hack > but works for now. > It would be nice to have some way of specyfying dependencies between > engines... On the other side it might unnecessary complicate things. > Something to think about later ;) > Regards, > Bragi > > On 09/12/05, Vincent AE Scott <[1]rails-e7je8kD1+OBeoWH0uzbU5w@public.gmane.org> wrote: > > Hi there, > I''ve just installed login_engine and user_engine from the > repositories, > followed the setup procedures as documented in: > vendor/plugins/user_engine/README > But I''m getting the following failure: > vince@vaio:~/Projects/Booking$ rake bootstrap > (in /home/vince/Projects/Booking) > rake aborted! > undefined method `edit'' for class `UserController'' > I''ve commented out the following: > # We need to wrap around the old edit > # alias :old_edit :edit > # def edit > # @all_roles = Role.find_all.select { |r| [2]r.name !> # UserEngine.config(:guest_role_name) } > # old_edit > # end > (vendor/plugins/user_engine/app/controllers/user_controller.rb) > It appears to have worked correctly and created the the default > roles. > Is this just depreciated code/bug, or will i run into problems > later on? > Cheers, > -v#endif /* bragi.ragnarson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org */ -- keys: http://codex.net/gpg.asc Just remember, once you''re over the hill you begin to pick up speed. -- Arthur Schopenhauer
Hi, This means that UserEngine is right now configured to request login when you access login page. My first guess is to cleanup roles, permissions and users tables and start bootstrap again. If this will not work you will have to manually (through SQL interface or using rails console) add permission to ''user/login'' to ''Guest'' role. Regards, Bragi On 09/12/05, Vincent AE Scott <rails-e7je8kD1+OBeoWH0uzbU5w@public.gmane.org> wrote:> > Excellent, that worked fine, cheers. > but now I''ve encountered another problem, attempting to navigate to the > /user page fails to prompt with a login screen. The browsers > (galeon/firefox) are reporting "redirected too many times". I have > stopped WEBrick, deleted the sessions, removed the cookies and started > over, but its still doing it. > > #if bragi.ragnarson /* Dec 09, 06:36 */ > > > > Hi Vincent, > > edit following file: > > $RAILS_ROOT/vendor/plugins/user_engine/app/models/permission.rb > > In method synchronize_with_controllers find lines that say: > > # we need to load all the controllers... > > controller_files.each do |file_name| > > and add a sort call in the second one: > > # we need to load all the controllers... > > controller_files.sort.each do |file_name| > > Remove comments from the UserController and everything should work > > fine. > > There is a dependency between UserEngine and LoginEngine which is not > > taken into account while loading controllers. It is just a quick hack > > but works for now. > > It would be nice to have some way of specyfying dependencies between > > engines... On the other side it might unnecessary complicate things. > > Something to think about later ;) > > Regards, > > Bragi > > > > On 09/12/05, Vincent AE Scott <[1]rails-e7je8kD1+OBeoWH0uzbU5w@public.gmane.org> wrote: > > > > Hi there, > > I''ve just installed login_engine and user_engine from the > > repositories, > > followed the setup procedures as documented in: > > vendor/plugins/user_engine/README > > But I''m getting the following failure: > > vince@vaio:~/Projects/Booking$ rake bootstrap > > (in /home/vince/Projects/Booking) > > rake aborted! > > undefined method `edit'' for class `UserController'' > > I''ve commented out the following: > > # We need to wrap around the old edit > > # alias :old_edit :edit > > # def edit > > # @all_roles = Role.find_all.select { |r| [2]r.name !> > # UserEngine.config(:guest_role_name) } > > # old_edit > > # end > > (vendor/plugins/user_engine/app/controllers/user_controller.rb) > > It appears to have worked correctly and created the the default > > roles. > > Is this just depreciated code/bug, or will i run into problems > > later on? > > Cheers, > > -v > > #endif /* bragi.ragnarson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org */ > > -- > keys: http://codex.net/gpg.asc > > Just remember, once you''re over the hill you begin to pick up speed. > -- Arthur Schopenhauer > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Bragi Ragnarson _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
#if bragi.ragnarson /* Dec 09, 08:17 */> > Hi, > This means that UserEngine is right now configured to request login > when you access login page. > My first guess is to cleanup roles, permissions and users tables and > start bootstrap again. If this will not work you will have to manually > (through SQL interface or using rails console) add permission to > ''user/login'' to ''Guest'' role. > Regards, > Bragiyes, spot on again. The permissions_roles table was empty, so i had to INSERT a row into it as you suggested. For anyone else having the same problem: SELECT id FROM roles WHERE name=''Guest''; # x SELECT id FROM permissions WHERE controller=''user'' AND action=''login''; # y INSERT into permissions_roles (role_id, permission_id) VALUES ( x, y ); If i get a chance over the weekend I''ll try and take a looksee as to why the bootstrap didn''t complete this task for me. -v> > On 09/12/05, Vincent AE Scott <[1]rails-e7je8kD1+OBeoWH0uzbU5w@public.gmane.org> wrote: > > Excellent, that worked fine, cheers. > but now I''ve encountered another problem, attempting to navigate to > the > /user page fails to prompt with a login screen. The browsers > (galeon/firefox) are reporting "redirected too many times". I have > stopped WEBrick, deleted the sessions, removed the cookies and > started > over, but its still doing it. > #if bragi.ragnarson /* Dec 09, 06:36 */ > > > > Hi Vincent, > > edit following file: > > $RAILS_ROOT/vendor/plugins/user_engine/app/models/permission.r > b > > In method synchronize_with_controllers find lines that say: > > # we need to load all the controllers... > > controller_files.each do |file_name| > > and add a sort call in the second one: > > # we need to load all the controllers... > > controller_files.sort.each do |file_name| > > Remove comments from the UserController and everything should > work > > fine. > > There is a dependency between UserEngine and LoginEngine which > is not > > taken into account while loading controllers. It is just a > quick hack > > but works for now. > > It would be nice to have some way of specyfying dependencies > between > > engines... On the other side it might unnecessary complicate > things. > > Something to think about later ;) > > Regards, > > Bragi > > > > On 09/12/05, Vincent AE Scott <[1]rails@ [2]codex.net> wrote: > > > > Hi there, > > I''ve just installed login_engine and user_engine from the > > repositories, > > followed the setup procedures as documented in: > > vendor/plugins/user_engine/README > > But I''m getting the following failure: > > vince@vaio:~/Projects/Booking$ rake bootstrap > > (in /home/vince/Projects/Booking) > > rake aborted! > > undefined method `edit'' for class `UserController'' > > I''ve commented out the following: > > # We need to wrap around the old edit > > # alias :old_edit :edit > > # def edit > > # @all_roles = Role.find_all.select { |r| [2]r.name !> > # UserEngine.config(:guest_role_name) } > > # old_edit > > # end > > (vendor/plugins/user_engine/app/controllers/user_controller. > rb) > > It appears to have worked correctly and created the the > default > > roles. > > Is this just depreciated code/bug, or will i run into > problems > > later on? > > Cheers, > > -v > #endif /* [3]bragi.ragnarson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org */ > -- > keys: [4]http://codex.net/gpg.asc > Just remember, once you''re over the hill you begin to pick up > speed. > -- Arthur Schopenhauer > _______________________________________________ > Rails mailing list > [5]Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > [6]http://lists.rubyonrails.org/mailman/listinfo/rails > > -- > Bragi Ragnarson > > References > > 1. mailto:rails-e7je8kD1+OBeoWH0uzbU5w@public.gmane.org > 2. http://codex.net/ > 3. mailto:bragi.ragnarson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > 4. http://codex.net/gpg.asc > 5. mailto:Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > 6. http://lists.rubyonrails.org/mailman/listinfo/rails> _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails#endif /* bragi.ragnarson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org */ -- keys: http://codex.net/gpg.asc Brain: an apparatus with which we think we think. -- Ambrose Bierce
I have found it is an issue with needing to save the role before the permissions are added. I created a new rake file for the bootstrap to fix this, but have not yet submitted it. Below you will find new code for only the :create_roles task plugins/user_engine/tasks/user_engine.rake --------------- desc ''Create the default roles'' task :create_roles => :environment do # Create the Guest Role if Role.find_by_name(UserEngine.config(:guest_role_name)) == nil puts "Creating guest role ''#{UserEngine.config(:guest_role_name)}''" guest = Role.new guest.name = UserEngine.config(:guest_role_name) guest.description = "Implicit role for all accessors of the site" guest.system_role = true guest.omnipotent = false guest.save guest.permissions << Permission.find_by_controller_and_action(''user'', ''login'') guest.permissions << Permission.find_by_controller_and_action(''user'', ''forgot_password'') guest.permissions << Permission.find_by_controller_and_action(''user'', ''signup'') end @all_action_permissions = Permission.find_all # Create the Admin role if Role.find_by_name(UserEngine.config(:admin_role_name)) == nil puts "Creating admin role ''#{UserEngine.config(:admin_role_name)}''" admin = Role.new admin.name = UserEngine.config(:admin_role_name) admin.description = "The system administrator, with REAL ULTIMATE POWER." admin.omnipotent = true admin.system_role = true admin.save @all_action_permissions.each { |permission| if !admin.permissions.include?(permission) admin.permissions << permission end } end # Create the User role, if needed if Role.find_by_name(UserEngine.config(:user_role_name)) == nil puts "Creating user role ''#{UserEngine.config(:user_role_name)}''" user = Role.new user.name = UserEngine.config(:user_role_name) user.description = "The default role for all logged-in users" user.system_role = true user.omnipotent = false user.save # all users automatically get the Guest permissions implicitly user.permissions << Permission.find_by_controller_and_action(''user'', ''logout'') user.permissions << Permission.find_by_controller_and_action(''user'', ''home'') user.permissions << Permission.find_by_controller_and_action(''user'', ''change_password'') user.permissions << Permission.find_by_controller_and_action(''user'', ''edit'') end End ----------------- -Nb ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Nathaniel S. H. Brown http://nshb.net ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> -----Original Message----- > From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of > Vincent AE Scott > Sent: December 10, 2005 3:17 AM > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: Re: [Rails] UserEngine - rake bootstrap aborted > > #if bragi.ragnarson /* Dec 09, 08:17 */ > > > > Hi, > > This means that UserEngine is right now configured to > request login > > when you access login page. > > My first guess is to cleanup roles, permissions and > users tables and > > start bootstrap again. If this will not work you will > have to manually > > (through SQL interface or using rails console) add permission to > > ''user/login'' to ''Guest'' role. > > Regards, > > Bragi > > yes, spot on again. > > The permissions_roles table was empty, so i had to INSERT a > row into it as you suggested. For anyone else having the > same problem: > > SELECT id FROM roles WHERE name=''Guest''; # x SELECT id > FROM permissions WHERE controller=''user'' AND action=''login''; > # y INSERT into permissions_roles (role_id, permission_id) > VALUES ( x, y ); > > If i get a chance over the weekend I''ll try and take a > looksee as to why the bootstrap didn''t complete this task for me. > > -v > > > > > On 09/12/05, Vincent AE Scott <[1]rails-e7je8kD1+OBeoWH0uzbU5w@public.gmane.org> wrote: > > > > Excellent, that worked fine, cheers. > > but now I''ve encountered another problem, attempting > to navigate to > > the > > /user page fails to prompt with a login screen. The browsers > > (galeon/firefox) are reporting "redirected too many > times". I have > > stopped WEBrick, deleted the sessions, removed the cookies and > > started > > over, but its still doing it. > > #if bragi.ragnarson /* Dec 09, 06:36 */ > > > > > > Hi Vincent, > > > edit following file: > > > > $RAILS_ROOT/vendor/plugins/user_engine/app/models/permission.r > > b > > > In method synchronize_with_controllers find lines > that say: > > > # we need to load all the controllers... > > > controller_files.each do |file_name| > > > and add a sort call in the second one: > > > # we need to load all the controllers... > > > controller_files.sort.each do |file_name| > > > Remove comments from the UserController and > everything should > > work > > > fine. > > > There is a dependency between UserEngine and > LoginEngine which > > is not > > > taken into account while loading controllers. It is just a > > quick hack > > > but works for now. > > > It would be nice to have some way of specyfying > dependencies > > between > > > engines... On the other side it might unnecessary > complicate > > things. > > > Something to think about later ;) > > > Regards, > > > Bragi > > > > > > On 09/12/05, Vincent AE Scott <[1]rails@ > [2]codex.net> wrote: > > > > > > Hi there, > > > I''ve just installed login_engine and > user_engine from the > > > repositories, > > > followed the setup procedures as documented in: > > > vendor/plugins/user_engine/README > > > But I''m getting the following failure: > > > vince@vaio:~/Projects/Booking$ rake bootstrap > > > (in /home/vince/Projects/Booking) > > > rake aborted! > > > undefined method `edit'' for class `UserController'' > > > I''ve commented out the following: > > > # We need to wrap around the old edit > > > # alias :old_edit :edit > > > # def edit > > > # @all_roles = Role.find_all.select { |r| > [2]r.name !> > > # UserEngine.config(:guest_role_name) } > > > # old_edit > > > # end > > > > (vendor/plugins/user_engine/app/controllers/user_controller. > > rb) > > > It appears to have worked correctly and created the the > > default > > > roles. > > > Is this just depreciated code/bug, or will i run into > > problems > > > later on? > > > Cheers, > > > -v > > #endif /* [3]bragi.ragnarson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org */ > > -- > > keys: [4]http://codex.net/gpg.asc > > Just remember, once you''re over the hill you begin to pick up > > speed. > > -- Arthur Schopenhauer > > _______________________________________________ > > Rails mailing list > > [5]Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > [6]http://lists.rubyonrails.org/mailman/listinfo/rails > > > > -- > > Bragi Ragnarson > > > > References > > > > 1. mailto:rails-e7je8kD1+OBeoWH0uzbU5w@public.gmane.org > > 2. http://codex.net/ > > 3. mailto:bragi.ragnarson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > 4. http://codex.net/gpg.asc > > 5. mailto:Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > 6. http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > #endif /* bragi.ragnarson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org */ > > -- > keys: http://codex.net/gpg.asc > > Brain: an apparatus with which we think we think. > -- Ambrose Bierce > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Hi all Nathaniel has been busy finding these bugs, and filing requests on the Engines Trac site, which I''d encourage you all to peruse. I should have a bug fix version out late next week - alas, Real Life is forcing me to focus my energies elsewhere until then.... - james On 12/10/05, Nathaniel S. H. Brown <nshb-wgYSSEAWXinQT0dZR+AlfA@public.gmane.org> wrote:> I have found it is an issue with needing to save the role before the > permissions are added. I created a new rake file for the bootstrap to fix > this, but have not yet submitted it. > > Below you will find new code for only the :create_roles task > plugins/user_engine/tasks/user_engine.rake > > --------------- > desc ''Create the default roles'' > task :create_roles => :environment do > > # Create the Guest Role > if Role.find_by_name(UserEngine.config(:guest_role_name)) == nil > puts "Creating guest role ''#{UserEngine.config(:guest_role_name)}''" > guest = Role.new > guest.name = UserEngine.config(:guest_role_name) > guest.description = "Implicit role for all accessors of the site" > guest.system_role = true > guest.omnipotent = false > guest.save > > guest.permissions << Permission.find_by_controller_and_action(''user'', > ''login'') > guest.permissions << Permission.find_by_controller_and_action(''user'', > ''forgot_password'') > guest.permissions << Permission.find_by_controller_and_action(''user'', > ''signup'') > end > > @all_action_permissions = Permission.find_all > > # Create the Admin role > if Role.find_by_name(UserEngine.config(:admin_role_name)) == nil > puts "Creating admin role ''#{UserEngine.config(:admin_role_name)}''" > admin = Role.new > admin.name = UserEngine.config(:admin_role_name) > admin.description = "The system administrator, with REAL ULTIMATE > POWER." > admin.omnipotent = true > admin.system_role = true > > admin.save > > @all_action_permissions.each { |permission| > if !admin.permissions.include?(permission) > admin.permissions << permission > end > } > end > > # Create the User role, if needed > if Role.find_by_name(UserEngine.config(:user_role_name)) == nil > puts "Creating user role ''#{UserEngine.config(:user_role_name)}''" > user = Role.new > user.name = UserEngine.config(:user_role_name) > user.description = "The default role for all logged-in users" > user.system_role = true > user.omnipotent = false > user.save > > # all users automatically get the Guest permissions implicitly > user.permissions << Permission.find_by_controller_and_action(''user'', > ''logout'') > user.permissions << Permission.find_by_controller_and_action(''user'', > ''home'') > user.permissions << Permission.find_by_controller_and_action(''user'', > ''change_password'') > user.permissions << Permission.find_by_controller_and_action(''user'', > ''edit'') > end > End > ----------------- > > -Nb > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Nathaniel S. H. Brown http://nshb.net > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > -----Original Message----- > > From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of > > Vincent AE Scott > > Sent: December 10, 2005 3:17 AM > > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > Subject: Re: [Rails] UserEngine - rake bootstrap aborted > > > > #if bragi.ragnarson /* Dec 09, 08:17 */ > > > > > > Hi, > > > This means that UserEngine is right now configured to > > request login > > > when you access login page. > > > My first guess is to cleanup roles, permissions and > > users tables and > > > start bootstrap again. If this will not work you will > > have to manually > > > (through SQL interface or using rails console) add permission to > > > ''user/login'' to ''Guest'' role. > > > Regards, > > > Bragi > > > > yes, spot on again. > > > > The permissions_roles table was empty, so i had to INSERT a > > row into it as you suggested. For anyone else having the > > same problem: > > > > SELECT id FROM roles WHERE name=''Guest''; # x SELECT id > > FROM permissions WHERE controller=''user'' AND action=''login''; > > # y INSERT into permissions_roles (role_id, permission_id) > > VALUES ( x, y ); > > > > If i get a chance over the weekend I''ll try and take a > > looksee as to why the bootstrap didn''t complete this task for me. > > > > -v > > > > > > > > On 09/12/05, Vincent AE Scott <[1]rails-e7je8kD1+OBeoWH0uzbU5w@public.gmane.org> wrote: > > > > > > Excellent, that worked fine, cheers. > > > but now I''ve encountered another problem, attempting > > to navigate to > > > the > > > /user page fails to prompt with a login screen. The browsers > > > (galeon/firefox) are reporting "redirected too many > > times". I have > > > stopped WEBrick, deleted the sessions, removed the cookies and > > > started > > > over, but its still doing it. > > > #if bragi.ragnarson /* Dec 09, 06:36 */ > > > > > > > > Hi Vincent, > > > > edit following file: > > > > > > $RAILS_ROOT/vendor/plugins/user_engine/app/models/permission.r > > > b > > > > In method synchronize_with_controllers find lines > > that say: > > > > # we need to load all the controllers... > > > > controller_files.each do |file_name| > > > > and add a sort call in the second one: > > > > # we need to load all the controllers... > > > > controller_files.sort.each do |file_name| > > > > Remove comments from the UserController and > > everything should > > > work > > > > fine. > > > > There is a dependency between UserEngine and > > LoginEngine which > > > is not > > > > taken into account while loading controllers. It is just a > > > quick hack > > > > but works for now. > > > > It would be nice to have some way of specyfying > > dependencies > > > between > > > > engines... On the other side it might unnecessary > > complicate > > > things. > > > > Something to think about later ;) > > > > Regards, > > > > Bragi > > > > > > > > On 09/12/05, Vincent AE Scott <[1]rails@ > > [2]codex.net> wrote: > > > > > > > > Hi there, > > > > I''ve just installed login_engine and > > user_engine from the > > > > repositories, > > > > followed the setup procedures as documented in: > > > > vendor/plugins/user_engine/README > > > > But I''m getting the following failure: > > > > vince@vaio:~/Projects/Booking$ rake bootstrap > > > > (in /home/vince/Projects/Booking) > > > > rake aborted! > > > > undefined method `edit'' for class `UserController'' > > > > I''ve commented out the following: > > > > # We need to wrap around the old edit > > > > # alias :old_edit :edit > > > > # def edit > > > > # @all_roles = Role.find_all.select { |r| > > [2]r.name !> > > > # UserEngine.config(:guest_role_name) } > > > > # old_edit > > > > # end > > > > > > (vendor/plugins/user_engine/app/controllers/user_controller. > > > rb) > > > > It appears to have worked correctly and created the the > > > default > > > > roles. > > > > Is this just depreciated code/bug, or will i run into > > > problems > > > > later on? > > > > Cheers, > > > > -v > > > #endif /* [3]bragi.ragnarson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org */ > > > -- > > > keys: [4]http://codex.net/gpg.asc > > > Just remember, once you''re over the hill you begin to pick up > > > speed. > > > -- Arthur Schopenhauer > > > _______________________________________________ > > > Rails mailing list > > > [5]Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > [6]http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > -- > > > Bragi Ragnarson > > > > > > References > > > > > > 1. mailto:rails-e7je8kD1+OBeoWH0uzbU5w@public.gmane.org > > > 2. http://codex.net/ > > > 3. mailto:bragi.ragnarson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > > 4. http://codex.net/gpg.asc > > > 5. mailto:Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > 6. http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > > > Rails mailing list > > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > #endif /* bragi.ragnarson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org */ > > > > -- > > keys: http://codex.net/gpg.asc > > > > Brain: an apparatus with which we think we think. > > -- Ambrose Bierce > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Maybe Matching Threads
- Modules, controllers and inheritance
- UserEngine - rake bootstrap aborted => undefined method `synchronize_with_controllers'' for Permission:Class
- UserEngine -- Permission.synchronize_with_controllers -- trouble with my own controller modules
- Railspdf plugin problem
- Routing problems - Apache proxy vs. Webrick direct