t
r
Hey!
Hey!
You can use the auth guard as the docs says and pass the sessionRequired boolean as false in it. This way, you can then check if the ctx.session object is defined in the api logic and if it’s not defined, the user is not logged in.
t
Yeah, that's cool. But I meant if I could use this syntax: can("write", "post") and it'd would depend on user role, which I defined in Session object?
r
hmm. Im not sure about that. Maybe @porcellus can help here.
(in an few hours)
p
hi, I'm not really familiar with
GuardBuilder
which project is it from?
Anyway, adding a builder like this to your project should be fairly straightforward, but it's not something we provide out of the box. If this is a built-in in, maybe there is a way to make it work, but I don't see it in NestJs docs. if you could point me to the right docs I can check.
p
I'll take a look
t
p
hmm, I was looking for GuardBuilder
anyway
It looks like the
can
and
cannot
calls should not interface with our library
so you can use this syntax, it should not be a problem
t
to sum up: I can use your library for authentification and "can, cannot" library for authorization?
p
yeah, I think that should work.
r
the docs are point to localhost @porcellus - might wanna change the link
p
yeah, I've just noticed
It's not as well integrated with nestjs, but this is also a possibility