Ejemplo n.º 1
0
        private void Edit_Privacy(string PageIndexID)
        {
            Security.Pages.PrivacyMgr myPrivacyMgr = new Security.Pages.PrivacyMgr();

            // Page Index
            e2Data[] UpdateData_PrivacyURL =
            {
                new e2Data("PageIndexID", PageIndexID),
                new e2Data("ReturnURL",   tbx_ReturnURL.Text)
            };

            if (myPrivacyMgr.Chk_Page_PrivacyURL(PageIndexID))
            {
                myPrivacyMgr.Edit_Page_PrivacyURL(UpdateData_PrivacyURL);
            }
            else
            {
                myPrivacyMgr.Add_Page_PrivacyURL(UpdateData_PrivacyURL);

                // Add Administrator and Guest Role to Privacy
                // Administrator
                e2Data[] UpdateData_Admin =
                {
                    new e2Data("PageIndexID",             PageIndexID),
                    new e2Data("UserGroupID",             StringEnum.GetStringValue(Security.Users.UserGroup.Administrator)),
                    new e2Data("Allow_View",              "1"),
                    new e2Data("Allow_Create",            "1"),
                    new e2Data("Allow_Modify",            "1"),
                    new e2Data("Allow_Delete",            "1"),
                    new e2Data("Allow_Rollback",          "1"),
                    new e2Data("Allow_ChangePermissions", "1"),
                    new e2Data("Allow_Approve",           "1"),
                    new e2Data("Allow_Publish",           "1"),
                    new e2Data("Allow_DesignMode",        "1")
                };

                myPrivacyMgr.Add_Page_Privacy(UpdateData_Admin);

                // Guest
                e2Data[] UpdateData =
                {
                    new e2Data("PageIndexID",             _pageindexid),
                    new e2Data("UserGroupID",             StringEnum.GetStringValue(Security.Users.UserGroup.Guest)),
                    new e2Data("Allow_View",              "1"),
                    new e2Data("Allow_Create",            "0"),
                    new e2Data("Allow_Modify",            "0"),
                    new e2Data("Allow_Delete",            "0"),
                    new e2Data("Allow_Rollback",          "0"),
                    new e2Data("Allow_ChangePermissions", "0"),
                    new e2Data("Allow_Approve",           "0"),
                    new e2Data("Allow_Publish",           "0"),
                    new e2Data("Allow_DesignMode",        "0")
                };

                myPrivacyMgr.Add_Page_Privacy(UpdateData);
            }
        }
Ejemplo n.º 2
0
        protected void btn_AddRoles_Click(object sender, EventArgs e)
        {
            Security.Pages.PrivacyMgr myPrivacyMgr = new Security.Pages.PrivacyMgr();

            lbl_AddRolesError.Text = "";
            if (myPrivacyMgr.Chk_Page_Privacy(_pageindexid, droplist_UserGroup.SelectedValue))
            {
                lbl_AddRolesError.Text = "User role already existed!";
                return;
            }

            // Add New Role
            e2Data[] UpdateData =
            {
                new e2Data("PageIndexID",             _pageindexid),
                new e2Data("UserGroupID",             droplist_UserGroup.SelectedValue),
                new e2Data("Allow_View",              "1"),
                new e2Data("Allow_Create",            "0"),
                new e2Data("Allow_Modify",            "0"),
                new e2Data("Allow_Delete",            "0"),
                new e2Data("Allow_Rollback",          "0"),
                new e2Data("Allow_ChangePermissions", "0"),
                new e2Data("Allow_Approve",           "0"),
                new e2Data("Allow_Publish",           "0"),
                new e2Data("Allow_DesignMode",        "0")
            };

            myPrivacyMgr.Add_Page_Privacy(UpdateData);

            Control_Init();
        }