Exemplo n.º 1
0
        private void PopulateViewEditAccess(ref List <KeyValuePair <int, KeyValuePair <bool, bool> > > ViewEditColl)
        {
            string StateFIPS = userProfileViewData.StateFIPS;

            foreach (UserRegionalAccessProfile profile in userProfileViewData.RegionalProfiles)
            {
                if (userProfileViewData.IsUserAgencyScope)
                {
                    var CanView = AccessRulesBLL.CanViewAgencyUser(profile.RegionId, profile.IsAdmin, StateFIPS, AdminViewData);
                    var CanEdit = AccessRulesBLL.CanEditAgencyUser(profile.RegionId, profile.IsAdmin, StateFIPS, profile.IsApproverDesignate, AdminViewData);
                    ViewEditColl.Add(new KeyValuePair <int, KeyValuePair <bool, bool> >(profile.RegionId, new KeyValuePair <bool, bool>(CanView, CanEdit)));
                }
                else if (userProfileViewData.IsUserSubStateRegionalScope)
                {
                    var CanView = AccessRulesBLL.CanViewSubStateUser(profile.RegionId, profile.IsAdmin, StateFIPS, AdminViewData);
                    var CanEdit = AccessRulesBLL.CanEditSubStateUser(profile.RegionId, profile.IsAdmin, StateFIPS, profile.IsApproverDesignate, AdminViewData);
                    ViewEditColl.Add(new KeyValuePair <int, KeyValuePair <bool, bool> >(profile.RegionId, new KeyValuePair <bool, bool>(CanView, CanEdit)));
                }
                else if (userProfileViewData.IsUserCMSRegionalScope)
                {
                    var CanView = AccessRulesBLL.CanViewUserProfile(userProfileViewData, AdminViewData);
                    var CanEdit = AccessRulesBLL.CanEditUserProfile(userProfileViewData, AdminViewData);
                    ViewEditColl.Add(new KeyValuePair <int, KeyValuePair <bool, bool> >(profile.RegionId, new KeyValuePair <bool, bool>(CanView, CanEdit)));
                }
            }
        }
Exemplo n.º 2
0
        protected bool IsViewAccessAllowed(int RegionId)
        {
            bool IsAllowed = false;

            //return AccessRulesBLL.CanEditUserProfile(this.userProfileViewData, UserBLL.GetUser(this.AccountInfo.UserId));
            if (userProfileViewData.IsUserSubStateRegionalScope)
            {
                UserRegionalAccessProfile subStateProfile = userProfileViewData.RegionalProfiles.Where(p => p.RegionId == RegionId).FirstOrDefault();
                if (subStateProfile != null)
                {
                    IsAllowed = AccessRulesBLL.CanViewSubStateUser(subStateProfile.RegionId,
                                                                   subStateProfile.IsAdmin,
                                                                   userProfileViewData.StateFIPS,
                                                                   AdminViewData);
                }
            }
            else if (userProfileViewData.IsUserAgencyScope)
            {
                UserRegionalAccessProfile AgencyProfile = userProfileViewData.RegionalProfiles.Where(p => p.RegionId == RegionId).FirstOrDefault();
                if (AgencyProfile != null)
                {
                    IsAllowed = AccessRulesBLL.CanViewAgencyUser(AgencyProfile.RegionId,
                                                                 AgencyProfile.IsAdmin,
                                                                 userProfileViewData.StateFIPS,
                                                                 AdminViewData);
                }
            }
            else if (userProfileViewData.IsUserCMSRegionalScope)
            {
                UserRegionalAccessProfile CMSRegionalProfile = userProfileViewData.RegionalProfiles.Where(p => p.RegionId == RegionId).FirstOrDefault();
                if (CMSRegionalProfile != null)
                {
                    IsAllowed = AccessRulesBLL.CanViewUserProfile(userProfileViewData, AdminViewData);
                }
            }

            return(IsAllowed);
        }
Exemplo n.º 3
0
 private bool IsAuthorized()
 {
     return(AccessRulesBLL.CanViewUserProfile(userProfileViewData, ViewerUserData));
     //return AccessRulesBLL.CheckReadOnlyAccess(this.AccountInfo, this.userProfileViewData);
 }