[web2py] Re: Enforcing access control on Flash file embedded inside a view

2011-08-18 Thread Massimo Di Pierro
You can use routes and make it look to the browser as if the file is in static (where it originally was) even it you promoted to a view (which access control in controller). On Jul 29, 3:57 am, Jagmal jag...@gmail.com wrote: Thanks Massimo. I think it works (I tried by using response.render -

[web2py] Re: Enforcing access control on Flash file embedded inside a view

2011-08-18 Thread Jagmal
I guess I need more help. Please bear with me. I assume that you are suggesting the following approach: If I have a SWF at /APP/static/file.swf, then I should create following entry in routes_in in routes.py (r'.*/APP/static/file.swf', r'/APP/controller/file') And in

[web2py] Re: Enforcing access control on Flash file embedded inside a view

2011-07-29 Thread Jagmal
Thanks Massimo. I think it works (I tried by using response.render - is there any other way as .swf is not a recognized extension?). But, I now have a more interesting problem. This FLASH file actually depends on multiple files/folders in the same folder (including some XMLs for data, audio

[web2py] Re: Enforcing access control on Flash file embedded inside a view

2011-07-29 Thread Massimo Di Pierro
Not sure what .swf is not a recognized extension means in this context. Are you saying it is not setting up the content-type? You have a going point. One solution (although not the most elegant) is to use routes.py to map the path (/app/static/...) into the new one (/app/controller/...). Massimo

[web2py] Re: Enforcing access control on Flash file embedded inside a view

2011-07-29 Thread Jagmal
Not sure what .swf is not a recognized extension means in this context. Are you saying it is not setting up the content-type? Sorry - my ignorance and incorrect words. Actually, I should have asked another question - How do I render a view which is not HTML (again a very basic question)?

Re: [web2py] Re: Enforcing access control on Flash file embedded inside a view

2011-07-29 Thread Bruno Rocha
You are missing the fact that upliad folder is pritected. Accessible only via download function. http://zerp.ly/rochacbruno Em 27/07/2011 12:37, Jagmal jag...@gmail.com escreveu: Does 'upload' field not just copy file over to a location and provide its link when asked? If so, I should be able

[web2py] Re: Enforcing access control on Flash file embedded inside a view

2011-07-27 Thread Jagmal
To be clear: Let us say I have a view app/default/view.html, which has a flash file (say FLASH.swf) embedded inside it. One can access this view only if s/he has proper permission. The flash file is supposed to be accessible only on permission too. But, what if someone tries to directly access

[web2py] Re: Enforcing access control on Flash file embedded inside a view

2011-07-27 Thread Massimo Di Pierro
Can you move it? Put it under views, create a controller with the same name and link that. You can have the controller check for permissions. On Jul 27, 5:18 am, Jagmal jag...@gmail.com wrote: To be clear: Let us say I have a view app/default/view.html, which has a flash file (say FLASH.swf)

Re: [web2py] Re: Enforcing access control on Flash file embedded inside a view

2011-07-27 Thread Bruno Rocha
You can put the flash file referenced in 'upload' field in database, then use download function + auth to check permissions to it. On Wed, Jul 27, 2011 at 7:18 AM, Jagmal jag...@gmail.com wrote: To be clear: Let us say I have a view app/default/view.html, which has a flash file (say

Re: [web2py] Re: Enforcing access control on Flash file embedded inside a view

2011-07-27 Thread Jagmal
Does 'upload' field not just copy file over to a location and provide its link when asked? If so, I should be able to access the file directly anyhow by looking at the URL in the final HTML. Am I missing anything?