public bool HasChannelPermissions(int siteId, int channelId) { if (channelId == 0) { return(false); } if (IsSystemAdministrator) { return(true); } var dictKey = GetChannelPermissionDictKey(siteId, channelId); if (ChannelPermissionDict.ContainsKey(dictKey)) { return(true); } var parentChannelId = ChannelManager.GetParentId(siteId, channelId); return(HasChannelPermissions(siteId, parentChannelId)); }
public bool HasChannelPermissions(int siteId, int channelId, params string[] permissions) { while (true) { if (channelId == 0) { return(false); } if (IsSystemAdministrator) { return(true); } var dictKey = GetChannelPermissionDictKey(siteId, channelId); if (ChannelPermissionDict.ContainsKey(dictKey) && HasChannelPermissions(ChannelPermissionDict[dictKey], permissions)) { return(true); } var parentChannelId = ChannelManager.GetParentId(siteId, channelId); channelId = parentChannelId; } }