# |
Jul 2nd 2019, 20:44 |
joey.mukherjee |
Thanks, that worked! I had `$this->loadHelper ('CakeDC/Users.User');` in there but I guess I need the AuthLink as well. Are there others that I should be aware of? |
# |
Jul 2nd 2019, 20:29 |
rochasmarcelo |
load it inside your AppView ```public function initialize() { $this->loadHelper('CakeDC/Users.AuthLink'); ```` |
# |
Jul 2nd 2019, 20:24 |
joey.mukherjee |
I don't have this everywhere apparently. I am getting a Missing Helper error. For me to have this in my baked views, I am adding this to the top: `use CakeDC\Users\View\Helper\AuthLinkHelper;`. but it doesn't work. What is the right namespace? |
# |
Jul 2nd 2019, 20:04 |
rochasmarcelo |
https://github.com/CakeDC/users/blob/master/src/View/Helper/AuthLinkHelper.php |
# |
Jul 2nd 2019, 20:03 |
joey.mukherjee |
Thanks @rochasmarcelo, that worked... I have never seen AuthLink. Where is that? |
# |
Jul 2nd 2019, 20:03 |
ricksaccous |
oh cool, is that a thing? interesting |
# |
Jul 2nd 2019, 20:01 |
rochasmarcelo |
like ``` $this->AuthLink->isAuthorized($url)``` |
# |
Jul 2nd 2019, 20:01 |
rochasmarcelo |
or AuthLink::isAuthorized |
# |
Jul 2nd 2019, 20:00 |
rochasmarcelo |
AuthLink::link |
# |
Jul 2nd 2019, 20:00 |
rochasmarcelo |
@joey check AuthLink |
# |
Jul 2nd 2019, 19:57 |
ricksaccous |
no, you can create your own helper though |
# |
Jul 2nd 2019, 19:56 |
joey.mukherjee |
So I need booleans for every little thing? That seems wrong to me. I think I am using the Rbac so it seems like there should be an easier way, but looking at the docs, it mentions identity traits and all that and I don't think I have any of that? |
# |
Jul 2nd 2019, 19:55 |
ricksaccous |
and pass it down to the view |
# |
Jul 2nd 2019, 19:55 |
ricksaccous |
you can set a canEdit boolean in the controller |
# |
Jul 2nd 2019, 19:54 |
ricksaccous |
it doesn't come with a helper |
# |
Jul 2nd 2019, 19:54 |
ricksaccous |
@joey.mukherjee indeed, that's a component not a helper |
# |
Jul 2nd 2019, 19:52 |
joey.mukherjee |
Hello all! I am using the CakeDC Users plugin. In my view, what is the correct/best way to show (or not) a link if the user is allowed to do what the link points to or not? I have this: `if ($this->Authorization->can ($role, 'edit'))` but it says I am missing the Authorization helper. |
# |
Jul 2nd 2019, 17:29 |
ricksaccous |
https://cakesf.slack.com/archives/C053DPNGT/p1562080052460900 |
# |
Jul 2nd 2019, 17:29 |
ricksaccous |
@olanowsubomi that was already explained to you |
# |
Jul 2nd 2019, 17:24 |
olanowsubomi |
it brought ' microsoft javasript runtime error ! |
# |
Jul 2nd 2019, 17:21 |
olanowsubomi |
i was able to open my downloaded bootstrap .css files alone. why? |
# |
Jul 2nd 2019, 17:19 |
olanowsubomi |
please, can someone not open file stored as .js on windows |
# |
Jul 2nd 2019, 17:12 |
ricksaccous |
it actually wasn't allowed via authentication and i thought it was |
# |
Jul 2nd 2019, 17:12 |
ricksaccous |
nevermind me being silly |
# |
Jul 2nd 2019, 17:06 |
ricksaccous |
they get redirected to login even if that request is authorized/allowed by authentication? |
# |
Jul 2nd 2019, 17:06 |
ricksaccous |
in chrome |
# |
Jul 2nd 2019, 17:06 |
ricksaccous |
window |
# |
Jul 2nd 2019, 17:06 |
ricksaccous |
where when opening a link in an incognito windows |
# |
Jul 2nd 2019, 17:06 |
ricksaccous |
has anyone ran into an issue |
# |
Jul 2nd 2019, 15:26 |
neon1024 |
VS Code is free and works on Windows :slightly_smiling_face: |
# |
Jul 2nd 2019, 15:07 |
ndm |
Get a proper code editor and associate the `.js` extension with it, or use the context menu to select the application in which to open the file. On Windows `.js` files are by default associated with Windows Script Host, which will try to run the script... |
# |
Jul 2nd 2019, 15:07 |
olanowsubomi |
it happens whenever i want to open the any directory on the downloaded file ie bootstrap.min.js |
# |
Jul 2nd 2019, 15:05 |
olanowsubomi |
pop up |
# |
Jul 2nd 2019, 15:05 |
olanowsubomi |
the pop is titled ' window script host ' |
# |
Jul 2nd 2019, 15:00 |
ricksaccous |
try to narrow down the error |
# |
Jul 2nd 2019, 15:00 |
ricksaccous |
can you access other js files/css files? |
# |
Jul 2nd 2019, 15:00 |
ricksaccous |
@olanowsubomi where are you seeing that error? in the browser? it's probably a bad server set up? |
# |
Jul 2nd 2019, 14:57 |
olanowsubomi |
at least i need to see the file structure !, ok i will get back to u after trying? |
# |
Jul 2nd 2019, 14:56 |
niel45 |
try a different browser, to verify it's not just specific to mico$oft |
# |
Jul 2nd 2019, 14:55 |
olanowsubomi |
but trying to open any bootstrap file is showing the mentioned error on window ' microsoft jscript compilation error ' |
# |
Jul 2nd 2019, 14:52 |
ricksaccous |
from what i remember |