private bool IsAuthorized(string idref, int businessUnitId)
        {
            Serialization.ReportCenterMetadata metadata = Serialization.Metadata.Instance.Cache;

            bool foundReport = false;

            bool authorized = false;

            foreach (Serialization.Report xmlReport in metadata.Reports)
            {
                if (!xmlReport.Id.Equals(idref))
                {
                    continue;
                }

                foundReport = true;

                if (xmlReport.Authorization == null)
                {
                    authorized = true;
                }
                else
                {
                    Acl <string> acl = new Acl <string>();

                    int i = 0, j = xmlReport.Authorization.Items.Length;

                    for (; i < j; i++)
                    {
                        string value = xmlReport.Authorization.Items[i];

                        switch (xmlReport.Authorization.ItemsElementName[i])
                        {
                        case Serialization.ItemsChoiceType.Allow:
                            acl.Install(AceType.Allow, new StringAce(value));
                            break;

                        case Serialization.ItemsChoiceType.Deny:
                            acl.Install(AceType.Deny, new StringAce(value));
                            break;
                        }
                    }

                    authorized = acl.Allow(businessUnitId.ToString());
                }
            }

            if (!foundReport)
            {
                throw new ReportNotFoundException(idref);
            }

            return(authorized);
        }