@giteeteam/apps-team-components 1.0.37 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -167,10 +167,21 @@ export function checkUserPermission({ transition, userId, roleIds, groupIds, ite
167
167
  }
168
168
  }
169
169
  if (hasUserFields) {
170
- const userFieldObj = pick(values, authUserFields.map(field => field.value || field.key));
170
+ const fieldKeys = authUserFields.map(field => field.value || field.key);
171
+ const userFieldObj = pick(values, fieldKeys);
171
172
  let hasAuth = false;
172
173
  const keys = Object.keys(userFieldObj);
174
+ if (fieldKeys.includes(ItemFieldType.reporter)) {
175
+ keys.push(ItemFieldType.reporter);
176
+ }
173
177
  for (let i = 0; i < keys.length; i++) {
178
+ if (keys[i] === ItemFieldType.reporter) {
179
+ const reporter = item[ItemFieldType.reporter] || {};
180
+ if (reporter.objectId === userId) {
181
+ hasAuth = true;
182
+ break;
183
+ }
184
+ }
174
185
  const fieldObj = userFieldObj[keys[i]];
175
186
  if (fieldObj && fieldObj.length) {
176
187
  hasAuth = fieldObj.map(user => user.value).includes(userId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giteeteam/apps-team-components",
3
- "version": "1.0.37",
3
+ "version": "1.1.0",
4
4
  "description": "Gitee team components",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",