Try our conversational search powered by Generative AI!

GetAccessRights(IUser) for room returns nothing... why?

Vote:
 

I'm sitting here making a call to GetAccessRights for an IUser and the RoomAccessRights object i have only has false values for a room, even if I set specific rights for a usergroup in admin. Is there another way to see if a user has a particular accessright to a room than this?

public static bool IsRoomMember(this RoomBase room, StarCommunity.Core.Modules.Security.IUser user)
{
if (room == null || user == null)
{
return false;
}

RoomAccessRights rights = room.GetAccessRights(user);
if (rights == null)
return false;
return rights.ReadRoom;

}

#35432
Dec 10, 2009 14:46
Vote:
 

GetAccessRights will only return the access rights set specifically for that user. If you have applied access rights to a usergroup as you say (I assume you mean an IGroup?), you'll have to call GetTotalAccessRights passing in your user for it to return your user's access rights merged with any inherited rights from groups.

Mattias

#36636
Feb 04, 2010 18:43
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.