@@ -85,8 +85,8 @@ private MongoCollection<CasbinRule> getCollection() {
85
85
}
86
86
87
87
/**
88
- * 从存储加载所有策略规则
89
- * 加载时会合并重复数据
88
+ * Loads all policy rules from the storage.
89
+ * Duplicates are merged during loading.
90
90
*
91
91
* @param model the model.
92
92
*/
@@ -112,7 +112,7 @@ Map<String, ArrayList<ArrayList<String>>> loading() {
112
112
.collect (Collectors .toMap (
113
113
x -> x .get (0 ), y -> {
114
114
ArrayList <ArrayList <String >> lists = new ArrayList <>();
115
- // 去除list第一项策略类型
115
+ // Remove the first item (policy type) from the list
116
116
y .remove (0 );
117
117
lists .add (y );
118
118
return lists ;
@@ -124,8 +124,8 @@ Map<String, ArrayList<ArrayList<String>>> loading() {
124
124
}
125
125
126
126
/**
127
- * 将所有策略规则保存到存储
128
- * 保存时会合并重复数据
127
+ * Saves all policy rules to the storage.
128
+ * Duplicates are merged during saving.
129
129
*
130
130
* @param model the model.
131
131
*/
@@ -137,7 +137,7 @@ public void savePolicy(Model model) {
137
137
}
138
138
139
139
/**
140
- * 将策略规则添加到存储
140
+ * Adds a policy rule to the storage.
141
141
*
142
142
* @param sec the section, "p" or "g".
143
143
* @param ptype the policy type, "p", "p2", .. or "g", "g2", ..
@@ -160,7 +160,7 @@ void adding(String sec, String ptype, List<String> rule) {
160
160
}
161
161
162
162
/**
163
- * 从存储中删除策略规则
163
+ * Removes a policy rule from the storage.
164
164
*
165
165
* @param sec the section, "p" or "g".
166
166
* @param ptype the policy type, "p", "p2", .. or "g", "g2", ..
@@ -186,7 +186,7 @@ void removing(String sec, String ptype, int fieldIndex, String... fieldValues) {
186
186
}
187
187
188
188
/**
189
- * 从存储中删除当前策略指定索引后匹配的数据
189
+ * Removes policy rules that match the specified field index and values from the storage.
190
190
*
191
191
* @param sec the section, "p" or "g".
192
192
* @param ptype the policy type, "p", "p2", .. or "g", "g2", ..
0 commit comments