This looks like it's exactly what I need, but the call I make returns an empty DataSet. I've verified that the various ID's I'm passing into ForumRoleInfoProvider.GetPermissionMatrix() valid. And I can see that the roles in the Forum_ForumRoles table exist for the ForumID I'm passing in.
The one thing I did different from what's in you example - I already have a ForumInfo object (which contains the corresponding ForumGroupID value), so My call looks like this:
public static bool AccessAllowed(UserInfo user, ForumInfo forum)
{
ResourceInfo ri = ResourceInfoProvider.GetResourceInfo("cms.forums");
DataSet dsMatrix = ForumRoleInfoProvider.GetPermissionMatrix(ri.ResourceID, SiteContext.CurrentSiteID, forum.ForumGroupID, forum.ForumID);
foreach (DataRow dr in dsMatrix.Tables[0].Rows)
{
bool allowed = ValidationHelper.GetBoolean(dr["Allowed"], false);
if (allowed)
{
// do something
}
}
return false;
}
Any suggestions?