# Bizarre interaction problem between acts\_as\_authenticated and a flash mp3 player

**URL:** <https://www.ruby-forum.com/t/bizarre-interaction-problem-between-acts-as-authenticated-and-a-flash-mp3-player/121399>\
**Category:** Rails\
**Created:** [November 27, 2007, 5:05pm UTC](https://www.ruby-forum.com/t/bizarre-interaction-problem-between-acts-as-authenticated-and-a-flash-mp3-player/121399 "2007-11-27T17:05:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jebw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/77aa72/32.png) [@jebw](https://www.ruby-forum.com/u/jebw)\
**Post date:** [November 27, 2007, 5:05pm UTC](https://www.ruby-forum.com/t/bizarre-interaction-problem-between-acts-as-authenticated-and-a-flash-mp3-player/121399/1 "2007-11-27T17:05:13Z")

</div>

I’m getting an odd problem where a flash movie (a simple mp3 player)  
does not load up correctly if a user is not logged in with an admin  
role. I’m using Acts As Authenticated and RoleRequirement plugins.  
After a day of debugging, this problem appears to be linked to the  
following code in acts as authenticated.

def self.included(base)  
base.send :helper\_method, :current\_user, :logged\_in?  
end

The flash file is just held in public, and whilst it does load it  
shows incorrectly and wont play any mp3 files - works fine when logged  
in as an admin (and yes its not access rights on the mp3 files).

Has anyone else encountered any odd behaviour like this, I’m at a  
loss. Neither the View nor Layout code contain references to  
current\_user or logged\_in? functions, I’ve also commented out all  
references to require\_role and login\_required in the controllers and  
parent ApplicationController.

Thanks

jebw

---

<div class="post-metadata">

**Author:** ![jebw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/77aa72/32.png) [@jebw](https://www.ruby-forum.com/u/jebw)\
**Post date:** [November 27, 2007, 5:51pm UTC](https://www.ruby-forum.com/t/bizarre-interaction-problem-between-acts-as-authenticated-and-a-flash-mp3-player/121399/2 "2007-11-27T17:51:33Z")

</div>

Follow up for anyone interested. The reason I could find the issue was  
I was looking at the wrong request! The page was loading fine, but jw  
mp3player was calling back to the url of the page its in with the last  
part replace by ‘playlist’

eg if its in

/mycontroller/myaction/myid

the flash movie then makes a call to

/mycontroller/myaction/playlist

which didn’t exist but the resulting behaviour changed depending on  
whether a user was an admin or not. In the end it had nothing to do  
with Acts As Authenticated or RoleRequirement, they just confused the  
issue.

cheers

jebw
