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.
我想知道在我的 Web 应用程序中存储自定义权限的理想位置在哪里。
例如我有以下权限:
管理员权限读取权限写入权限
目前我将这些作为常量字符串类型对象存储在静态实用程序类中。
谢谢
不知何故,我猜你在谈论一个 Java 应用程序。您可以尝试将这些资源外部化到文件中,例如在 Tomcat 中(例如tomcat-users.xml)。
tomcat-users.xml
决定采用枚举引用 xml 配置中的记录的数据库方法。