コード例 #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();
    }