예제 #1
0
        ///<summary>Used to check if user has permission to access the report. Pass in a list of DisplayReports to avoid a call to the db.</summary>
        public static bool HasReportPermission(string reportName, Userod user, List <DisplayReport> listReports = null)
        {
            //No need to check RemotingRole; no call to db.
            if (!Security.IsAuthorized(Permissions.Reports, true))
            {
                return(false);
            }
            DisplayReport report = (listReports ?? DisplayReports.GetAll(false)).FirstOrDefault(x => x.InternalName == reportName);

            if (report == null)           //Report is probably hidden.
            {
                return(false);
            }
            List <GroupPermission> listReportPermissions = GroupPermissions.GetPermsForReports();

            if (listReportPermissions.Exists(x => x.FKey == report.DisplayReportNum && Userods.IsInUserGroup(user.UserNum, x.UserGroupNum)))
            {
                return(true);
            }
            return(false);
        }
예제 #2
0
 public bool IsInUserGroup(long userGroupNum)
 {
     return(Userods.IsInUserGroup(this.UserNum, userGroupNum));
 }