Example #1
0
        /// <summary>
        /// Gets the user priviledges from the list.
        /// </summary>
        private Privileges GetUserPrivileges()
        {
            AdminBLL objMOSSService = new AdminBLL();
            Privileges objPrivileges = null;

            CommonUtility objUtility = new CommonUtility();
               string userId = objUtility.GetUserName();
               DataTable dtSystemPrivileges = objMOSSService.GetDWBPrivileges(strParentSiteURL, userId, SYSTEMPRIVILEGES);

            if (dtSystemPrivileges != null )
            {
                objPrivileges = objMOSSService.SetPrivilegesObjects(strParentSiteURL, dtSystemPrivileges);
            }
            else
            {
                objPrivileges = new Privileges();
                objPrivileges.IsNonDWBUser = true;
            }

            if (dtSystemPrivileges != null)
            {
                dtSystemPrivileges.Dispose();
            }
            return objPrivileges;
        }
Example #2
0
        /// <summary>
        /// Gets the user priviledges from the list.
        /// </summary>
        protected DWBDataObjects.Privileges GetUserPrivileges()
        {
            AdminBLL objAdminBLL = new AdminBLL();
            DWBDataObjects.Privileges objPrivileges;

            CommonUtility objUtility = new CommonUtility();
            string strUserId = objUtility.GetUserName();
            DataTable dtSystemPrivileges = objAdminBLL.GetDWBPrivileges(strParentSiteURL, strUserId, USERSESSIONSYSTEMPRIVILEGES);

            if (dtSystemPrivileges != null)
            {
                objPrivileges = objAdminBLL.SetPrivilegesObjects(strParentSiteURL, dtSystemPrivileges);
            }
            else
            {
                objPrivileges = new DWBDataObjects.Privileges();
                objPrivileges.IsNonDWBUser = true;
            }

            if (dtSystemPrivileges != null)
            {
                dtSystemPrivileges.Dispose();
            }

            return objPrivileges;
        }
Example #3
0
        /// <summary>
        /// Sets the System and Staff level privileges based on the entries in the datatable.
        /// </summary>
        /// <param name="strSiteURL">The STR site URL.</param>
        /// <param name="systemPrivileges">The system privileges.</param>
        /// <returns>Privilege collection.</returns>
        public Privileges SetPrivilegesObjects(string strSiteURL, DataTable systemPrivileges)
        {
            Privileges objPrivileges = new Privileges();
            string strPrivilege = string.Empty;
            SystemPrivileges objSystemPrivileges = null;
            if (systemPrivileges == null || systemPrivileges.Rows.Count == 0)
            {
                objPrivileges.IsNonDWBUser = true;
                return objPrivileges;
            }
            if (systemPrivileges != null && systemPrivileges.Rows.Count > 0)
            {
                if (systemPrivileges.Rows[0]["Privileges"] != DBNull.Value)
                    strPrivilege = (string)systemPrivileges.Rows[0]["Privileges"];
                if (!string.IsNullOrEmpty(strPrivilege))
                {
                    objSystemPrivileges = this.SetSytemPrivileges(strPrivilege);
                }
                if (objSystemPrivileges != null)
                {
                    objSystemPrivileges.UserRecordID = Convert.ToInt32(systemPrivileges.Rows[0]["ID"].ToString());
                    objSystemPrivileges.Discipline = systemPrivileges.Rows[0]["Discipline"].ToString();
                }

                /// Get the Teams the user is member of
                CommonBLL objCommonBLL = new CommonBLL();
                string strCAMLQuery = string.Empty;
                string strViewFields = string.Empty;

                strCAMLQuery = @"<OrderBy><FieldRef Name='Team_ID' /></OrderBy>
                                                    <Where>
                                                        <Eq>
                                                            <FieldRef Name='User_ID' />
                                                            <Value Type='Number'>" + systemPrivileges.Rows[0]["ID"].ToString() + "</Value>" +
                                        "</Eq>" +
                                     "</Where>";
                strViewFields = @"<FieldRef Name='Team_ID' /><FieldRef Name='User_ID' /><FieldRef Name='ID' />";
                DataTable dtResultTable = objCommonBLL.ReadList(strSiteURL, DWBTEAMSTAFFLIST, strCAMLQuery, strViewFields);
                StringBuilder sbTeamId = new StringBuilder();
                FocalPoint objFocalPoint = new FocalPoint();
                if (dtResultTable != null && dtResultTable.Rows.Count > 0)
                {
                    foreach (DataRow dtRow in dtResultTable.Rows)
                    {
                        sbTeamId.Append(Convert.ToString(dtRow["Team_ID"]));
                        sbTeamId.Append("|");
                    }
                    objFocalPoint.TeamIDs = sbTeamId.ToString();
                    dtResultTable.Dispose();
                }

                /// Get the Books owned by user
                dtResultTable = null;
                strCAMLQuery = string.Empty;
                strViewFields = string.Empty;
                strCAMLQuery = @"<Where><Eq><FieldRef Name='Owner' /><Value Type='Lookup'>" + systemPrivileges.Rows[0]["Windows_User_ID"].ToString() + "</Value></Eq></Where>";
                strViewFields = @"<FieldRef Name='Owner' /><FieldRef Name='ID' /><FieldRef Name='Title' /><FieldRef Name='Team_ID' />";
                dtResultTable = objCommonBLL.ReadList(strSiteURL, DWBBOOKLIST, strCAMLQuery, strViewFields);
                if (dtResultTable != null && dtResultTable.Rows.Count > 0)
                {
                    sbTeamId = new StringBuilder();
                    foreach (DataRow dtRow in dtResultTable.Rows)
                    {
                        sbTeamId.Append(Convert.ToString(dtRow["Team_ID"]));
                        sbTeamId.Append("|");
                    }

                    objFocalPoint.BookIDs = sbTeamId.ToString();
                    dtResultTable.Dispose();
                }
                objPrivileges.SystemPrivileges = objSystemPrivileges;
                objPrivileges.FocalPoint = objFocalPoint;
            }
            return objPrivileges;
        }
Example #4
0
        /// <summary>
        /// Gets the user priviledges from the list.
        /// </summary>
        private void GetUserPrivileges()
        {
            objAdminBLL = new AdminBLL();
            string strParentSiteUrl = HttpContext.Current.Request.Url.ToString();
            strUserId = objUtility.GetUserName();
            DataTable dtSystemPrivileges = objAdminBLL.GetDWBPrivileges(strParentSiteUrl, strUserId, SYSTEMPRIVILEGES);

            if (dtSystemPrivileges != null)
            {
                objPrivileges = objAdminBLL.SetPrivilegesObjects(strParentSiteUrl, dtSystemPrivileges);
            }
            else
            {
                objPrivileges = new Privileges();
                objPrivileges.IsNonDWBUser = true;
            }

            if (dtSystemPrivileges != null)
            {
                dtSystemPrivileges.Dispose();
            }
        }