Displaying 20 results from an estimated 1000 matches similar to: "role based authorization question"
2006 Apr 27
7
Role Based Authorization recipe implementation?
i got the rails recipes book, i have now an auth system for users
without problems, now i want to made a role based acces for my app, im
following the "Role Based Authorization" recipe of the book but i cant
make it to work even when the tables created and correctly added data
manually definig the roles and rights. als i dont know how to define a
right for use all the actions in a
2006 Apr 25
0
completely stuck on Role-Based Authorization
Im completely stuck on Role-Based Authorization (I used the rails recipe
method)
(user_controller.rb)
def login
return if generate_blank
@user = User.new(@params[''user''])
if @session[''user''] = User.authenticate(@params[''user''][''login''],
@params[''user''][''password''])
2006 Jan 12
2
Web services and login?
Has anyone managed to do this? I thought about using sessions but they
dont want to work for me... Here''s what I''m doing as a little test:
class NotLoggedIn < Exception
end
class ProjectsController < ApplicationController
wsdl_service_name ''Projects''
web_service_api ProjectsApi
def Login
@session[:loggedIn] = true
end
def GetProjects
2007 Jul 17
12
Getting past my login system
Thank you in advance for your help. I am relatively new to both Rails
and Rspec and I am hoping for some insight from some experienced veterans.
Right now I am using Rspec for code that has already been written so
that additional functionality can be developed using the BDD method. My
problem shows up when I try to spec controllers that are behind the
login system. Each page checks for the
2006 Apr 17
2
probably easy q: flash before redirect
I''m a little perplexed why this isn''t working:
private
def check_authorization
user = User.find(session[:user])
if user.level == 100
flash[:notice] = "welcome, admin"
else
flash[:notice] = "ha ha"
redirect_to :controller
2006 Nov 04
0
Having problems with edge rails
I just switched to Edge Rails (revision 5207) since I want to use the
BigDecimal support for an e-commerce website.. Unfortunately, some of
my old code seems to be breaking things..
First off, it looks like my "skip_before_filter :check_authentication,
:check_authorization, :only => [:login, :forgot_password]" doesn''t
work at all, since the before_filter gets executed for
2009 Jul 25
3
Rails Authorization and Security question
Working through the Users and Authentication of Learning Rails book
(great book, code needs to be proof-read in a few cases, though), I
came across this:
There''s still one leftover that may be worth addressing, depending on
your security needs. The authorization? method has secured the data,
and the view no longer shows the user options they can''t really use,
but if a
2007 Jan 21
0
Functional Test Fails with before filter in application.rb
Hi There,
I am trying to write my first tests for a role bassed authentication
taken from Rails Recipies. Whenever I add:
assert_redirected_to :action => ''login''
I get the following error:
NoMethodError: undefined method `first'' for :user:Symbol
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.1/lib/action_controller/assertions/response_assertions.rb:72:in
2012 Apr 11
0
F5 SLB iRule - POP3 TLS Offload & Add Realm
Hey Guys,
I figured someone might have use of this at some point. I've created an
iRule for our F5 Load Balancer which performs the following tasks:
- Appends STLS to the POP3 Capability list (it does this blindly, so
expects the backend POP3 server to not return this)
- Watches for the STLS command and initiates SSL negotiation with the
client (leaves the connection to the
2007 Jan 04
8
Common setup code and naming specifications
Hello!
I have a lot of contexts for testing Rails controllers, that must do
something like ''session[:logged_in] = true'' in their setup. How can this
be refactored? In unit tests I would simply create a
LoggedInControllerTest base class, that all my functional tests would
derive from.
And another small question:
In my controller specifications I often have to decide whether to
2006 Jun 04
5
filter function with parameter
Hi!
I want to add a function with a static paramter ("2" in the example) to
a filter, but somehow Rails seems to be looking for another syntax.
before_filter :check_quantity(2), :only => [:show]
doesn''t work. What''s the right way to do this?
Thanks a lot!
--
Posted via http://www.ruby-forum.com/.
2006 May 16
2
before_filter and the application controller
Hi there,
I''m having a bit of an issue with my before_filter. I know that the filters
put in the application.rb controller are global for all the controllers. In
my application filter I''d like to allow access to the RSS feed method in a
''member'' controller and skip the login checks that the before_filters are
currently performing.
In my application my filters
2008 Apr 30
1
Avelsieve 1.9.7 and Dovecot/TLS
Hi,
i'm installing a new mail server for our faculty and want to use
the squirrelmail plugin 'avelsieve' (1.9.7). As documented on the
dovecot wiki there is a problem in the STARTTLS code and i
found a solution (that works for my installation):
i've traced the server output in 'get_response' and instead of
a script list i saw "IMPLEMENTATION". So i took a look
2006 Jul 07
13
Rails Recipes Book: Authentication
Hi,
The user/login management system in Chapter 31: Authenticating Your
Users and Chapter 32: Authorizing Users with Roles of Chad Fowler''s
Rails Recipes looks reasonable and adequate. However, when I ran the
Chapter 31 code, I get the following error:
Username or password invalid
And I am not even given the chance to sign in; that is, the signin form
does not appear at all.
Has
2008 Oct 03
2
Filter chain halted as [:check_authentication] rendered_or_r
I have this page that you login in from. You get authenticated and then
bumped over to the appropriate page depending on what your role is:
Traveler, Travel Manager, Admin. All pieced work except for the role
asssociated with Travel Managers who get tossed out, apprarently when
they hit a before_filter to check authenication. However, it seams that
they are properly getting authenticated and moved
2006 Mar 03
5
Message Board?
I''m interested in working on a message board application that uses ruby on
rails.
I''d like to see something end up similar to vBullieten, but with more of a
37signals type of less-is-more philosophy... mostly meaning less need for
preferences and settings and configurations.
I''ve checked rubyforge, and it looks like there are various forum apps
uploaded there, some
2006 Jan 29
6
tyro Ruby questin
Trying to print out a simple database grid, using, with column headers
such as ''SunToSatRoles'', ''PrimaryRoles'', etcetera.
Iterating through an object @List which is populated thusly
@list = mymodel.find(:all, :order => mymodel.editlist_order)
When I do something like
<table>
<% for i in @list %>
<tr>
<td><%= i.inspect
2008 May 06
12
Why before_filter is not working?
I have been scratching my head on this one for most of the day.
Hopefully someone can help explain why before_filter isn''t working for
my codes.
In my Application controller, I have this:
before_filter :login_required, :except =>
[:newacct, :create_newacct, :passwd_reset ]
def login_required
unless session[:user_id]
flash[:notice] = "Please log in"
2006 Apr 21
1
Catch authentication result from a model in a controller
Im still following the authorization recipe from the book, now all works
fine but im getting trouble in how handle the model authorization
result, if the user and pass are correct, it goes to a welcome
screen(admin.rhtml) but if wrong the model prints a message in an ugly
exception like page "usr and pass not correct", i want to redirect the
user to the login
2006 May 19
7
AR transactions and isolation levels
I''m trying to create a sequence with no gaps in my db (contrived
example, but should work out the same as my real one), and believe
db-managed transactions are the way to go about this.
It''s my first real ''go'' at transactions, so I may be mistaken about
how things really work.
Anyway.. Consider this example code:
Class Invoice < ActiveRecord::Base
def