Beispiel #1
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                // Check some credentials/properties and decide then which controls to show.
                // enable/disable the controls for logged in visitors.
                phNotLoggedIn.Visible    = !Request.IsAuthenticated;
                phLoggedIn.Visible       = Request.IsAuthenticated;
                phLoggedInBottom.Visible = Request.IsAuthenticated;
                phAdministrate.Visible   = SessionAdapter.CanAdministrate();
                phSupportQueues.Visible  = SessionAdapter.HasSystemActionRight(ActionRights.QueueContentManagement);

                // check if the user has the action right to approve attachments on some forum. If so, show the menu item
                List <int> forumsWithApprovalRight = SessionAdapter.GetForumsWithActionRight(ActionRights.ApproveAttachment);
                phAttachmentApproval.Visible = ((forumsWithApprovalRight != null) && (forumsWithApprovalRight.Count > 0));
            }
        }