Ejemplo n.º 1
0
        /// <summary>
        /// Gives a role permissions for a page that has already been created.
        /// </summary>
        /// <param name="setting">Grant, Deny, Unchecked</param>
        /// <param name="permission">The name of the Permission such as View, Edit, Add, Add Content etc.</param>
        /// <param name="pageName">The name of the page.</param>
        /// <param name="roleName">The name of the role.</param>
        public void SetPagePermissionForRole(string setting, string permission, string pageName, string roleName)
        {
            Span homeSpan = PageSpans.Filter(Find.ByText(s => s.Contains(pageName)))[0];

            // Fires the left click event
            homeSpan.FireEvent("oncontextmenu");
            Thread.Sleep(1000);
            PageSettingsLink.Click();
            Thread.Sleep(1500);
            PageSettingsPage _pageSettings = new PageSettingsPage(this);

            _pageSettings.PermissionsTabLink.Click();
            _pageSettings.SetPermissionForRole(setting, permission, roleName);
            _pageSettings.UpdatePageLink.Click();
            Thread.Sleep(1500);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gives a user edit permissions for a page that has already been created.
        /// </summary>
        /// <param name="pageName">The name of the page that the user will get edit permissions for.</param>
        /// <param name="userName">The name of the user that will be given edit permissions.</param>
        /// <param name="displayName">The display name of the user.</param>
        public void EditPageGiveUserEditPermissions(string pageName, string userName, string displayName)
        {
            Span homeSpan = PageSpans.Filter(Find.ByText(s => s.Contains(pageName)))[0];

            // Fires the left click event
            homeSpan.FireEvent("oncontextmenu");
            Thread.Sleep(1000);
            PageSettingsLink.Click();
            Thread.Sleep(1500);
            PageSettingsPage _pageSettings = new PageSettingsPage(this);

            _pageSettings.PermissionsTabLink.Click();
            Thread.Sleep(1500);
            _pageSettings.GiveUserEditPermissionsForPage(userName, displayName);
            Thread.Sleep(1500);
            _pageSettings.UpdatePageLink.Click();
            Thread.Sleep(1500);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Adds a page using the Pages bulk add page field.
        /// Sets the template for the page to the template specified
        /// </summary>
        /// <param name="pageName">The name of the page.</param>
        /// <param name="template">The name of the template.</param>
        public void AddPageSelectTemplate(string pageName, string template)
        {
            AddPage(pageName);
            Thread.Sleep(2500);
            Span pageSpan = PageSpans.Filter(Find.ByText(s => s.Contains(pageName)))[0];

            // Fires the left click event
            pageSpan.FireEvent("oncontextmenu");
            Thread.Sleep(1000);
            PageSettingsLink.Click();
            Thread.Sleep(1500);
            PageSettingsPage _pageSettings = new PageSettingsPage(this);

            _pageSettings.TemplateFolderSelectList.Select(template);
            Thread.Sleep(1500);
            _pageSettings.UpdateLink.Click();
            Thread.Sleep(1500);
        }