Beispiel #1
0
        protected void lbtn_Edit_Command(object sender, CommandEventArgs e)
        {
            Security.Pages.PrivacyMgr        myPrivacyMgr   = new Security.Pages.PrivacyMgr();
            Security.Pages.Page_Privacy_Full myPage_Privacy = myPrivacyMgr.Get_Page_Privacy_Full(e.CommandArgument.ToString());

            if (myPage_Privacy.UserGroupID == StringEnum.GetStringValue(Security.Users.UserGroup.Administrator))
            {
                Tools.AlertMessage.Show_Alert(this.Page, "<h4>Administrators permission can not be changed!", "Action failed!");
                return;
            }

            lbl_UserGroup.Text                   = myPage_Privacy.UserGroup_Name;
            chk_View.Checked                     = myPage_Privacy.Allow_View;
            chk_Create.Checked                   = myPage_Privacy.Allow_Create;
            chk_Modify.Checked                   = myPage_Privacy.Allow_Modify;
            chk_Delete.Checked                   = myPage_Privacy.Allow_Delete;
            chk_Rollback.Checked                 = myPage_Privacy.Allow_Rollback;
            chk_ChangePermission.Checked         = myPage_Privacy.Allow_ChangePermissions;
            chk_Approve.Checked                  = myPage_Privacy.Allow_Approve;
            chk_Publish.Checked                  = myPage_Privacy.Allow_Publish;
            chk_DesignMode.Checked               = myPage_Privacy.Allow_DesignMode;
            btn_UpdatePermission.CommandArgument = e.CommandArgument.ToString();

            Panel_Privacy.Visible = true;
        }
Beispiel #2
0
        protected void lbtn_Delete_Command(object sender, CommandEventArgs e)
        {
            Security.Pages.PrivacyMgr        myPrivacyMgr   = new Security.Pages.PrivacyMgr();
            Security.Pages.Page_Privacy_Full myPage_Privacy = myPrivacyMgr.Get_Page_Privacy_Full(e.CommandArgument.ToString());

            if (myPage_Privacy.UserGroupID == StringEnum.GetStringValue(Security.Users.UserGroup.Administrator) ||
                myPage_Privacy.UserGroupID == StringEnum.GetStringValue(Security.Users.UserGroup.Guest))
            {
                Tools.AlertMessage.Show_Alert(this.Page, "<h4>Administrators and Guest roles can not be deleted!", "Action failed!", 380, 100);
                return;
            }

            // Delete Role
            myPrivacyMgr.Remove_Page_Privacy(e.CommandArgument.ToString());

            // Update Permission List
            Control_Init();
        }