Role and user check authentication

Hi All,

I have an application with two modules. Let say Module1 and Module 2

Module 1 is holds all my UI part

Module 2 DB actions local data actions.

Application uses users for appliaction login and role tagging. 

Now my concern is login happens through Moudle 1 where 

IsUserProvider Property is set as No

User Provider Module as Users


Module 2:

IsUserProvider Property is set as Yes

User Provider Module as Current espace

If I try to check the role is registered role in Module2 with this above configuration will 

CheckRegisterdRole action returns me true or not?





Hi,

Why you use Users as user provider module 1 and is module 2 it's ow user provider?

Regards,

Daniel

As login authentication happens in Module1 and for user login/roles we make use of Users environment have marked it as Users.


Module2 has is own Current espace as user provider

Daniël Kuhlmann wrote:

Hi,

Why you use Users as user provider module 1 and is module 2 it's ow user provider?

Regards,

Daniel

As login authentication happens in Module1 and for user login/roles we make use of Users environment have marked it as Users.


Module2 has is own Current espace as user provider


Hi Ajithkumar Radhakrishnan,

You didn't explain why module 2 is it's own user provider... very rarely should this happen, and this will wreck havoc on your authorisations, as from module 2's perspective that user doesn't belong to it and does not have any role assigned.

Jorge is right. 

So set module2 IsUserProvider to false, UserProvider to Users. Any extra roles go define in module2.

Only use IsUserProvider if you want to implement a custom user authrntication.

Jorge Martins wrote:

Hi Ajithkumar Radhakrishnan,

You didn't explain why module 2 is it's own user provider... very rarely should this happen, and this will wreck havoc on your authorisations, as from module 2's perspective that user doesn't belong to it and does not have any role assigned.

Thanks Jorge.


Ya I know that but some how our team while development has made User Provider as CurrentEspace.


And it is not returning Module2 CheckRegisterRole is not returning false always in very few cases it is returning false. Few case it is true. 

Thats why I was surprised and asking this. IS there any reason for this?


Yes setting UserProvider to User whil make the CheckRegisteredRole to return true right?



Ajithkumar Radhakrishnan wrote: 

Yes setting UserProvider to User whil make the CheckRegisteredRole to return true right?

Yes, as it was already explained by Jorge and Daniël.

Cheers


Ajithkumar Radhakrishnan wrote:

And it is not returning Module2 CheckRegisterRole is not returning false always in very few cases it is returning false. Few case it is true. 

Thats why I was surprised and asking this. IS there any reason for this?

It will behave correctly if a user was assigned its role from within a module that uses module2 as User provider (which includes module2 itself).

But just reinforcing this here, as it is very important: it is highly unlikely that module2 was set up as a User Provider on purpose.

Please contact whomever developed module2 and ask them if they changed that setting on purpose. If it was, then they need to help you out understanding how to do authentication/authorisation properly. Most likely it got inadvertently setup this way (sometimes Blank modules are created like this) and no one noticed, until you need to deal with stuff like users/authentication and roles/authorisation.