Esempio n. 1
0
    private void DisplayOpMenu()
    {
        // get opId of article management
        OperationOpInfo opInfo = empAuth.GetOperationOpInfoByCommonClass("ArticleCommonOfBackend");

        if (opInfo != null)
        {
            opIdOfArticleMgmt = opInfo.OpId;
        }

        List <OperationWithRoleAuth> topList = empAuth.GetOperationWithRoleAuthNestedList(c.GetRoleName());

        if (c.IsInRole("admin"))
        {
            //管理者可以看到全部
            foreach (OperationWithRoleAuth op in topList)
            {
                op.CanRead = true;

                foreach (OperationWithRoleAuth subOp in op.SubItems)
                {
                    subOp.CanRead = true;
                }
            }
        }

        if (c.seCultureNameOfBackend == "en")
        {
            useEnglishSubject = true;
        }

        rptOpMenu.DataSource = topList;
        rptOpMenu.DataBind();
    }
    private void DisplayOperations()
    {
        List <OperationWithRoleAuth> topList = empAuth.GetOperationWithRoleAuthNestedList(ltrRoleName.Text);

        rptOperations.DataSource = topList;
        rptOperations.DataBind();

        btnSave.Visible = true;
    }