Example #1
0
 /// <summary>
 /// Reader returns fields:
 ///		GroupId, GroupName, Level
 /// </summary>
 public static IDataReader GetListGroupsAsTreeForIBN()
 {
     if (!Security.IsUserInGroup(InternalSecureGroups.Partner))
     {
         return(DBGroup.GetListGroupsAsTreeForIBN());
     }
     else
     {
         int PartnerGroupId = DBGroup.GetGroupForPartnerUser(Security.CurrentUser.UserID);
         return(DBGroup.GetListGroupsByPartner(PartnerGroupId, true, false));
     }
 }
Example #2
0
        /// <summary>
        ///		GroupId, GroupName
        /// </summary>
        public static DataTable GetListGroupsAsTreeDataTable()
        {
            DataTable dt;

            if (!Security.IsUserInGroup(InternalSecureGroups.Partner))
            {
                dt = new DataTable();
                dt.Columns.Add("GroupId", typeof(int));
                dt.Columns.Add("GroupName", typeof(string));
                GenerateTree(1, 0, ref dt);
            }
            else
            {
                int PartnerGroupId = DBGroup.GetGroupForPartnerUser(Security.CurrentUser.UserID);
                dt = DBGroup.GetListGroupsByPartnerDataTable(PartnerGroupId, true, false);
            }

            return(dt);
        }
Example #3
0
        public static bool CanRead(int GroupId)
        {
            bool RetVal = false;

            if (Security.IsUserInGroup(InternalSecureGroups.Partner))
            {
                int PartnerGroupId = DBGroup.GetGroupForPartnerUser(Security.CurrentUser.UserID);

                if (PartnerGroupId > 0)
                {
                    do
                    {
                        RetVal  = DBGroup.CheckGroupVisibilityForPartnerGroup(PartnerGroupId, GroupId);
                        GroupId = GetParentGroup(GroupId);
                    }while (!(GroupId <= 0 || RetVal));
                }
            }
            else
            {
                RetVal = true;
            }

            return(RetVal);
        }