Closed brianhks closed 11 years ago
Add uuid token to the dashboards table, auto-generate it when creating a dashboard.
Provide a public url to the dashboard at dashboards/public/
So if I follow you correctly then I add a new view to dashboards called 'public' That will give me my read only view of the dashboard doing the lookup by the UUID. Sounds good.
Yea
function beforeFilter(){
$this->allow('public')
}
function public($uuid){
$dashboard = $this->Dashboard->find('first', array(...));
if(empty($dashboard)) throw new UnauthorizedException();
//set view vars, render view template
fixed in d27b3b2a7ca624b4b55dd858de9603f967528b00
I see a problem with what you have done. You changed wid so that it has a dash '-' in it. The dash prevents me from using the wid in a js function name. It needs to be underscores '_'.
Ok. Feel free to change it. You can use uniqid() instead of String::uuid(), which doesn't have any dashes
Btw. Why do you need it in a js function name?
We are creating some complicated control widgets and in doing so it is best served to put some of the functionality into functions that are called from multiple places. Without wid in the function name we cannot have multiple control widgets on the page.
Brian
On Jul 12, 2013, at 1:45 AM, Rasmus Berg Palm notifications@github.com wrote:
Btw. Why do you need it in a js function name?
— Reply to this email directly or view it on GitHub.
You cant just use the wid as a parameter in the function? Anyways, feel free to change it :)
The idea is this
function myFunction_${wid}(someParam) {}
//Call function myFunction_${wid}('hello');
The wid is used as part of the function name, to make sure there are no clashes with other functions defined in other widgets. I'll create a patch.
Brian
On Fri, Jul 12, 2013 at 10:45 AM, Rasmus Berg Palm <notifications@github.com
wrote:
You cant just use the wid as a parameter in the function? Anyways, feel free to change it :)
— Reply to this email directly or view it on GitHubhttps://github.com/rasmusbergpalm/jslate/issues/30#issuecomment-20888695 .
One option for doing this is to make a dashboard public. When a dashboard is public authentication is skipped for that url. Would also have to make changes so the dashboard is read only. Any other suggestions?