Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个供学生、教师和管理员使用的系统。有时,讲师也可以是管理员。
我打算将菜单和子菜单存储在 XML 中。我应该将管理员和讲师菜单存储在单独的节点中,然后在渲染时将它们组合起来,还是应该有一个带有附加角色的主菜单,在确定角色时显示所有选项?
绝对将角色附加到主菜单选项,然后根据用户的角色将它们包含在菜单实例中。IMO 更加灵活和易于维护。