Implementing access management

Vote:
 

In admin you make groups and add users to various groups. I need to implement some access rights on my forum to separate forums between user groups and I can't find any documentation on this in the programmers handbook.

My app needs to check if a user is member of group and then add that to the list of things to show, likewise with rooms.

Anyone know how? It seems to be some mechanisms in episerver community for this, but I don't know where to start

 

/marius

#25364
Oct 22, 2008 15:55
Vote:
 

Hi Marius,

I don't really get your question. There is a property on the User object called Groups that will give you a GroupCollection of which groups that the user belongs to. You can iterate through this collection and check for a specific group. Is this what you are looking for?

//Tom

#25409
Oct 23, 2008 20:38
Vote:
 

Hi Tom, 

What I need is the methods to exclude any users not belonging to a group from viewing a forum.

Example: I have 2 forums. Forum A and Forum B. And three groups; Administrators, Members and Priviledged.
Forum A is open for Admins, Members. And Forum B is open for Admins and Priveledged. Users belonging to Members (All users are added to Members groups by default) will see Forum A, but not see Forum B. Any user belonging to Priveledged will se both forums. 

Explained better? The admin system has all these groups and access rights, but this must be handled manually by code I assume, as no front end stuff is automatic? If you told me that it is it probably saves me many days of work :)

<marius> 

#25427
Oct 24, 2008 12:47
Vote:
 

I'm stuck and need some help here. I'm still trying to implement some access control on my application. This is mye code so far as for adding Rooms to a collection:

StarCommunity.Modules.Forum.Forum forum = ForumHandler.GetForum(forumID); 
RoomCollection roomCollection = new RoomCollection();
foreach (Room room in forum.Rooms)
{
if(StarCommunity.Modules.Forum.Security.SecurityHandler.Instance.GetRoomAccessRights(room, CurrentUser).ReadRoom)
{ roomCollection.Add(room); }
}
When I look at the roomCollection it's count is 0 Undecided
#25501
Edited, Oct 28, 2008 13:55
This thread is locked and should be used for reference only. Please use the Legacy add-ons forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.