MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Asp.net Roles  (Mono Support )

17640 put(a) pogledan, 4 odgovor(a) 22.9.2014. 15:53:20Kreirao(la) Samtg
Samtg

Samtg

22.9.2014. 15:53:21
Hi,
     I was wanting to change the role of a friend, more specifically the privacy levels, and was wondering from this one article (http://www.mono-software.com/Blog/post/Mono/38/Support-for-ASP-NET-profiles-in-MonoX/), how would you implement this code, or an example of it:
UserProfileRepository.GetInstance().PrivacyLevelPrivate.Id

Also, could you use that for a link or button to indicate privacy?
Last, can you make a friend a role (so that only friends can access certain pages, and not others)?


Thanks.
Ovaj sadržaj još nije ocijenjen. 
440 Reputacija 38 Ukupno objava
khorvat

khorvat

24.9.2014. 10:07:56
Hi,

yes you can create the Friend role and use that role for page access permissions. I'm not so sure about your question related to privacy levels and roles as they are not connected in any way other than by business rules to compile relationship filters. If you were talking about the privacy level - Friends, you can't set the privacy level on user but you need to set the privacy level on e.g. user profile field and only then this field is exposed to your friends.

Please elaborate your question a bit more so we can provide you with better answer.

Regards
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava
Samtg

Samtg

26.9.2014. 5:43:50
I suppose, more specifically, say you were to let your friends have access to only certain parts of your profile, how would you programatically make that role?  (example publishers, administrators, have certain access, "friend" access role)

Thanks.
Ovaj sadržaj još nije ocijenjen. 
440 Reputacija 38 Ukupno objava
khorvat

khorvat

26.9.2014. 9:42:43
You can add access control functionality on that pages, and access control should check (early in the page life cycle) if user accessing the page is friend of that profile owner user, if so allow access if not reject the access. It's not a good practice to create a friend role as users can friend or unfriend at any time.

You have MonoX BLLs that can be used to check if user is friend with some other user and that can be used for ACL.

Regards
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava