similar to: roles, STI and convention

Displaying 20 results from an estimated 11000 matches similar to: "roles, STI and convention"

2007 Aug 11
2
Rspec and acl_system2 plugin
Hello, I''m trying to spec a Rails application using the couple restful_authentication/acl_system2 plugins. In my admin layout, I put the following code : <% restrict_to "admin" do -%> <ul id="admin-tabs"> <li> /users Users management </li> </ul> <% end -%> Then in my spec file
2006 Oct 09
5
Problem setting variables in ApplicationController.
I''m dynamically generating menu options based on the currently logged in user: current_user. My menus are setup on the applicatin.rhtml file. The current_user is defined in the application controller. But, attempting to assign it a value while in the application controller results in an ''undefined method'' error. ApplicationController .... def current_user @cu =
2008 Jul 12
1
Re: Re stful_authentication, Internet Explorer, and unwanted http basic dialog
I''m glad I found your post Joshua - it saved me quite a bit of time! To get this to work for me however (IE6), I had to ditch the ||= and do straight assignment: request.format = :html if request.env[''HTTP_USER_AGENT''] =~ /msie/i Joshua Doss wrote: > > > Alter access_denied to add this line (right below "def access_denied"): > >
2007 Aug 21
2
using restful_authentication current_user inside controller specs
I''m using restful_authentication in my app and I have the before filters in my application rhtml: before_filter :login_required around_filter :set_timezone around_filter :catch_errors Currently I have them commented out while rspec''in but I''ll need to add them in my specs. def create @ticket = Ticket.new(params[:ticket]) @ticket.user = current_user if
2008 May 21
8
before_filter with multiple roles
I have multiple roles in my application. Now I want to block a method for all users except the administrator and a manager. When I do this: before_filter (:check_administrator_role), :only => [:administration] before_filter (:check_taskmanager_role), :only => [:administration] The user must have both roles. How can I change that to an "OR" combination? -- Posted via
2006 Jul 11
0
Should I use exclamation marks for methods that change associations?
I''ve been getting some good feedback on the Authorization plugin (http://www.writertopia.com/developers/authorization). Josh Susser suggested I use exclamation marks when I''m setting roles. The basic ways of setting roles uses the #has_role, #has_no_role, #accepts_role, and #accepts_no_role methods: user.has_role ''site_admin'' user.has_role
2008 Oct 25
1
Returning a variable to before_filter
I know its probably doesnt sound right, but I am trying to call a before_filter method that will check whats the user role and then based on that return a string / hash / array to the before_filter something like this: class MonqiClassesController < ResourceController::Base before_filter :check_user_access_level , grant_access def check_user_access_level if
2007 Nov 13
2
More Rails Pattern Examples?
Hi, I have been reading the documentation and examples on the rspec site. There are two "patterns" from Rails that I am not clear how to implement that are kind of related, and so I am not sure how to start. Does anyone have any examples of how to write rspecs for these? 1/ Nested resources. 2/ Resources that are specific to the current_user. In other words, I only want to
2008 Jan 30
2
Where can I get "authenticate_with_http_basic"?
Hi, I just installed Rails 2.0.2 [root@mymachine easyx]# ruby --version ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux] [root@mymachine easyrx]# gem install rails --include-dependencies Need to update 16 gems from http://gems.rubyforge.org ................ complete Successfully installed rails-2.0.2 [root@remandev easyrx]# But I''m getting this error in my restful_authentication
2007 Jul 12
3
Agh, this is annoying. Why is this happening?
My problem: Mock ''Task_1005'' received unexpected message :user_id= with (1) No matter what I do to try to stub that out it will still fail out and give me that message. Here is my spec describe TasksController, "handling POST /tasks" do before(:each) do @task = mock_model(Task, :to_param => "1", :save => true)
2007 Jul 24
6
Mocking Access Control
I''m trying to jump on the TDD/BDD bandwagon, but am having trouble understanding how i should mock my user. The user has a habtm relationship to a roles model (acl_system2 plugin), but I''m not sure how to tell rspec about a model. My code: describe UsersController do integrate_views before(:each) do @user = mock_model(User)
2016 Jun 07
0
[PATCH v2 11/20] drm: sti: Rely on the default ->best_encoder() behavior
All outputs have a 1:1 relationship between connectors and encoders and the driver is relying on the atomic helpers: we can drop the custom ->best_encoder() implementations and let the core call drm_atomic_helper_best_encoder() for us. Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com> --- drivers/gpu/drm/sti/sti_dvo.c | 10 ---------- drivers/gpu/drm/sti/sti_hda.c
2020 Jan 10
0
[PATCH 18/23] drm/sti: Convert to CRTC VBLANK callbacks
VBLANK callbacks in struct drm_driver are deprecated in favor of their equivalents in struct drm_crtc_funcs. Convert sti over. Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de> --- drivers/gpu/drm/sti/sti_crtc.c | 11 ++++++++--- drivers/gpu/drm/sti/sti_crtc.h | 2 -- drivers/gpu/drm/sti/sti_drv.c | 3 --- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git
2016 Aug 26
0
[PATCH v8 16/18] ARM: DT: STi: stihxxx-b2120: Add DT nodes for STi audio card
This patch enables the uniperif players 2 & 3 for b2120 boards and also adds the "simple-audio-card" device node to interconnect the SoC sound device and the codec. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen at st.com> Signed-off-by: Peter Griffin <peter.griffin at linaro.org> --- arch/arm/boot/dts/stihxxx-b2120.dtsi | 45 ++++++++++++++++++++++++++++++++++++ 1
2016 Aug 26
0
[PATCH v8 14/18] ARM: STi: DT: STiH407: Add uniperif player dt nodes
This patch adds the DT nodes for the uniperif player IP blocks found on STiH407 family silicon. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen at st.com> Signed-off-by: Peter Griffin <peter.griffin at linaro.org> --- arch/arm/boot/dts/stih407-family.dtsi | 76 +++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/arch/arm/boot/dts/stih407-family.dtsi
2007 Aug 10
1
How to spec a model method
Still new to Specs... How do I create a spec to test a model method? Specifically, here is my spec: #testing model describe User do it "should have many user roles" do User.reflect_on_association(:user_roles).should_not be_nil end it "should have many roles though user roles" do User.reflect_on_association(:roles).should_not be_nil end it "should know
2008 Jun 17
3
Help with error - uninitialized constant AuthenticatedSystem::Base64
I am using restful_Authentication plugin combined with the built-in http_basic authentication Rails 2.0.2 The following code in my controller seemed to work fine, 1. before_filter :authenticate 2. 3. def authenticate 4. case request.format 5. when Mime::XML, Mime::ATOM 6. if user = authenticate_with_http_basic { |name, pass| User.authenticate(name,
2016 Feb 12
0
[PATCH 16/17] drm/sti: removed optional dummy encoder mode_fixup function.
--- drivers/gpu/drm/sti/sti_tvout.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c index f2afcf5..24a3735 100644 --- a/drivers/gpu/drm/sti/sti_tvout.c +++ b/drivers/gpu/drm/sti/sti_tvout.c @@ -440,13 +440,6 @@ static void sti_tvout_encoder_dpms(struct drm_encoder *encoder, int mode) { } -static bool
2016 Feb 15
0
[PATCH v2 16/17] drm/sti: removed optional dummy encoder mode_fixup function.
mode_fixup function for encoder drivers became optional with patch http://patchwork.freedesktop.org/patch/msgid/1455106522-32307-1-git-send-email-palminha at synopsys.com This patch set nukes all the dummy mode_fixup implementations. (made on top of Daniel topic/drm-misc branch) Signed-off-by: Carlos Palminha <palminha at synopsys.com> --- drivers/gpu/drm/sti/sti_tvout.c | 10 ----------
2016 Feb 12
0
[PATCH 16/17] drm/sti: removed optional dummy encoder mode_fixup function.
--- drivers/gpu/drm/sti/sti_tvout.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c index f2afcf5..24a3735 100644 --- a/drivers/gpu/drm/sti/sti_tvout.c +++ b/drivers/gpu/drm/sti/sti_tvout.c @@ -440,13 +440,6 @@ static void sti_tvout_encoder_dpms(struct drm_encoder *encoder, int mode) { } -static bool