|
@@ -550,26 +550,26 @@ module.exports = (crowi) => {
|
|
|
* /users/{id}/give-read-only:
|
|
* /users/{id}/give-read-only:
|
|
|
* put:
|
|
* put:
|
|
|
* tags: [Users]
|
|
* tags: [Users]
|
|
|
- * operationId: ReadOnlyUser
|
|
|
|
|
|
|
+ * operationId: ReadOnly
|
|
|
* summary: /users/{id}/give-read-only
|
|
* summary: /users/{id}/give-read-only
|
|
|
- * description: Give user read only flag
|
|
|
|
|
|
|
+ * description: Give user read only access
|
|
|
* parameters:
|
|
* parameters:
|
|
|
* - name: id
|
|
* - name: id
|
|
|
* in: path
|
|
* in: path
|
|
|
* required: true
|
|
* required: true
|
|
|
- * description: id of user for read only
|
|
|
|
|
|
|
+ * description: id of user for read only access
|
|
|
* schema:
|
|
* schema:
|
|
|
* type: string
|
|
* type: string
|
|
|
* responses:
|
|
* responses:
|
|
|
* 200:
|
|
* 200:
|
|
|
- * description: Give user read only flag success
|
|
|
|
|
|
|
+ * description: Give user read only access success
|
|
|
* content:
|
|
* content:
|
|
|
* application/json:
|
|
* application/json:
|
|
|
* schema:
|
|
* schema:
|
|
|
* properties:
|
|
* properties:
|
|
|
* userData:
|
|
* userData:
|
|
|
* type: object
|
|
* type: object
|
|
|
- * description: data of read only user
|
|
|
|
|
|
|
+ * description: data of read only
|
|
|
*/
|
|
*/
|
|
|
router.put('/:id/give-read-only', loginRequiredStrictly, adminRequired, addActivity, async(req, res) => {
|
|
router.put('/:id/give-read-only', loginRequiredStrictly, adminRequired, addActivity, async(req, res) => {
|
|
|
const { id } = req.params;
|
|
const { id } = req.params;
|
|
@@ -585,8 +585,7 @@ module.exports = (crowi) => {
|
|
|
|
|
|
|
|
const serializedUserData = serializeUserSecurely(userData);
|
|
const serializedUserData = serializeUserSecurely(userData);
|
|
|
|
|
|
|
|
- // TODO: https://redmine.weseek.co.jp/issues/121247
|
|
|
|
|
- // activityEvent.emit('update', res.locals.activity._id, { action: SupportedAction.ACTION_ADMIN_USERS_GIVE_ADMIN });
|
|
|
|
|
|
|
+ activityEvent.emit('update', res.locals.activity._id, { action: SupportedAction.ACTION_ADMIN_USERS_GIVE_READ_ONLY });
|
|
|
|
|
|
|
|
return res.apiv3({ userData: serializedUserData });
|
|
return res.apiv3({ userData: serializedUserData });
|
|
|
}
|
|
}
|
|
@@ -603,26 +602,26 @@ module.exports = (crowi) => {
|
|
|
* /users/{id}/remove-read-only:
|
|
* /users/{id}/remove-read-only:
|
|
|
* put:
|
|
* put:
|
|
|
* tags: [Users]
|
|
* tags: [Users]
|
|
|
- * operationId: removeReadOnlyUser
|
|
|
|
|
|
|
+ * operationId: removeReadOnly
|
|
|
* summary: /users/{id}/remove-read-only
|
|
* summary: /users/{id}/remove-read-only
|
|
|
- * description: Remove user read only flag
|
|
|
|
|
|
|
+ * description: Remove user read only access
|
|
|
* parameters:
|
|
* parameters:
|
|
|
* - name: id
|
|
* - name: id
|
|
|
* in: path
|
|
* in: path
|
|
|
* required: true
|
|
* required: true
|
|
|
- * description: id of user for removing read only flag
|
|
|
|
|
|
|
+ * description: id of user for removing read only access
|
|
|
* schema:
|
|
* schema:
|
|
|
* type: string
|
|
* type: string
|
|
|
* responses:
|
|
* responses:
|
|
|
* 200:
|
|
* 200:
|
|
|
- * description: Remove user read only flag success
|
|
|
|
|
|
|
+ * description: Remove user read only access success
|
|
|
* content:
|
|
* content:
|
|
|
* application/json:
|
|
* application/json:
|
|
|
* schema:
|
|
* schema:
|
|
|
* properties:
|
|
* properties:
|
|
|
* userData:
|
|
* userData:
|
|
|
* type: object
|
|
* type: object
|
|
|
- * description: data of removed read only user
|
|
|
|
|
|
|
+ * description: data of removed read only
|
|
|
*/
|
|
*/
|
|
|
router.put('/:id/remove-read-only', loginRequiredStrictly, adminRequired, addActivity, async(req, res) => {
|
|
router.put('/:id/remove-read-only', loginRequiredStrictly, adminRequired, addActivity, async(req, res) => {
|
|
|
const { id } = req.params;
|
|
const { id } = req.params;
|
|
@@ -638,8 +637,7 @@ module.exports = (crowi) => {
|
|
|
|
|
|
|
|
const serializedUserData = serializeUserSecurely(userData);
|
|
const serializedUserData = serializeUserSecurely(userData);
|
|
|
|
|
|
|
|
- // TODO: https://redmine.weseek.co.jp/issues/121247
|
|
|
|
|
- // activityEvent.emit('update', res.locals.activity._id, { action: SupportedAction.ACTION_ADMIN_USERS_REMOVE_ADMIN });
|
|
|
|
|
|
|
+ activityEvent.emit('update', res.locals.activity._id, { action: SupportedAction.ACTION_ADMIN_USERS_REMOVE_READ_ONLY });
|
|
|
|
|
|
|
|
return res.apiv3({ userData: serializedUserData });
|
|
return res.apiv3({ userData: serializedUserData });
|
|
|
}
|
|
}
|