2
0
Эх сурвалжийг харах

give/remove to grant/revoke

ryoji-s 2 жил өмнө
parent
commit
2de566df69

+ 6 - 6
apps/app/public/static/locales/en_US/admin.json

@@ -745,8 +745,8 @@
       "remove_admin_access": "Remove admin access",
       "remove_admin_access": "Remove admin access",
       "cannot_remove": "You cannot remove yourself from administrator",
       "cannot_remove": "You cannot remove yourself from administrator",
       "give_admin_access": "Give admin access",
       "give_admin_access": "Give admin access",
-      "remove_read_only_access": "Remove read only access",
-      "give_read_only_access": "Give read only access",
+      "revoke_read_only_access": "Revoke read only access",
+      "grant_read_only_access": "Grant read only access",
       "send_invitation_email": "Send invitation email",
       "send_invitation_email": "Send invitation email",
       "resend_invitation_email": "Resend invitation email"
       "resend_invitation_email": "Resend invitation email"
     },
     },
@@ -1019,8 +1019,8 @@
     "ADMIN_USERS_DEACTIVATE": "Deactivate user",
     "ADMIN_USERS_DEACTIVATE": "Deactivate user",
     "ADMIN_USERS_GIVE_ADMIN": "Give admin access",
     "ADMIN_USERS_GIVE_ADMIN": "Give admin access",
     "ADMIN_USERS_REMOVE_ADMIN": "Remove admin access",
     "ADMIN_USERS_REMOVE_ADMIN": "Remove admin access",
-    "ADMIN_USERS_GIVE_READ_ONLY": "Give read only access",
-    "ADMIN_USERS_REMOVE_READ_ONLY": "Remove read only access",
+    "ADMIN_USERS_GRANT_READ_ONLY": "Grant read only access",
+    "ADMIN_USERS_REVOKE_READ_ONLY": "Revoke read only access",
     "ADMIN_USERS_SEND_INVITATION_EMAIL": "Resend invitation email",
     "ADMIN_USERS_SEND_INVITATION_EMAIL": "Resend invitation email",
     "ADMIN_USERS_REMOVE": "Remove user",
     "ADMIN_USERS_REMOVE": "Remove user",
     "ADMIN_USER_GROUP_CREATE": "Create User Group",
     "ADMIN_USER_GROUP_CREATE": "Create User Group",
@@ -1039,8 +1039,8 @@
   "toaster": {
   "toaster": {
     "give_user_admin": "Succeeded to give {{username}} admin",
     "give_user_admin": "Succeeded to give {{username}} admin",
     "remove_user_admin": "Succeeded to remove {{username}} admin",
     "remove_user_admin": "Succeeded to remove {{username}} admin",
-    "give_user_read_only": "Succeeded to give {{username}} read only",
-    "remove_user_read_only": "Succeeded to remove {{username}} read only",
+    "grant_user_read_only": "Succeeded to grant {{username}} read only",
+    "revoke_user_read_only": "Succeeded to revoke {{username}} read only",
     "activate_user_success": "Succeeded to activating {{username}}",
     "activate_user_success": "Succeeded to activating {{username}}",
     "deactivate_user_success": "Succeeded to deactivate {{username}}",
     "deactivate_user_success": "Succeeded to deactivate {{username}}",
     "remove_user_success": "Succeeded to removing {{username}}",
     "remove_user_success": "Succeeded to removing {{username}}",

+ 6 - 6
apps/app/public/static/locales/ja_JP/admin.json

@@ -753,8 +753,8 @@
       "remove_admin_access": "管理者から外す",
       "remove_admin_access": "管理者から外す",
       "cannot_remove": "自分自身を管理者から外すことはできません",
       "cannot_remove": "自分自身を管理者から外すことはできません",
       "give_admin_access": "管理者にする",
       "give_admin_access": "管理者にする",
-      "remove_read_only_access": "閲覧のみアクセス権を外す",
-      "give_read_only_access": "閲覧のみアクセス権を付与する",
+      "revoke_read_only_access": "閲覧のみアクセス権を外す",
+      "grant_read_only_access": "閲覧のみアクセス権を付与する",
       "send_invitation_email": "招待メールの送信",
       "send_invitation_email": "招待メールの送信",
       "resend_invitation_email": "招待メールの再送信"
       "resend_invitation_email": "招待メールの再送信"
     },
     },
@@ -1027,8 +1027,8 @@
     "ADMIN_USERS_DEACTIVATE": "ユーザーを停止する",
     "ADMIN_USERS_DEACTIVATE": "ユーザーを停止する",
     "ADMIN_USERS_GIVE_ADMIN": "管理者にする",
     "ADMIN_USERS_GIVE_ADMIN": "管理者にする",
     "ADMIN_USERS_REMOVE_ADMIN": "管理者から外す",
     "ADMIN_USERS_REMOVE_ADMIN": "管理者から外す",
-    "ADMIN_USERS_GIVE_READ_ONLY": "閲覧のみアクセス権を付与する",
-    "ADMIN_USERS_REMOVE_READ_ONLY": "閲覧のみアクセス権を外す",
+    "ADMIN_USERS_GRANT_READ_ONLY": "閲覧のみアクセス権を付与する",
+    "ADMIN_USERS_REVOKE_READ_ONLY": "閲覧のみアクセス権を外す",
     "ADMIN_USERS_SEND_INVITATION_EMAIL": "招待メールの再送信",
     "ADMIN_USERS_SEND_INVITATION_EMAIL": "招待メールの再送信",
     "ADMIN_USERS_REMOVE": "ユーザーの削除",
     "ADMIN_USERS_REMOVE": "ユーザーの削除",
     "ADMIN_USER_GROUP_CREATE": "ユーザーグループの作成",
     "ADMIN_USER_GROUP_CREATE": "ユーザーグループの作成",
@@ -1047,8 +1047,8 @@
   "toaster": {
   "toaster": {
     "give_user_admin": "{{username}}を管理者に設定しました",
     "give_user_admin": "{{username}}を管理者に設定しました",
     "remove_user_admin": "{{username}}を管理者から外しました",
     "remove_user_admin": "{{username}}を管理者から外しました",
-    "give_user_read_only": "{{username}}に閲覧のみアクセス権を付与しました",
-    "remove_user_read_only": "{{username}}から閲覧のみアクセス権を外しました",
+    "grant_user_read_only": "{{username}}に閲覧のみアクセス権を付与しました",
+    "revoke_user_read_only": "{{username}}から閲覧のみアクセス権を外しました",
     "activate_user_success": "{{username}}を有効化しました",
     "activate_user_success": "{{username}}を有効化しました",
     "deactivate_user_success": "{{username}}を無効化しました",
     "deactivate_user_success": "{{username}}を無効化しました",
     "remove_user_success": "{{username}}を削除しました",
     "remove_user_success": "{{username}}を削除しました",

+ 6 - 6
apps/app/public/static/locales/zh_CN/admin.json

@@ -753,8 +753,8 @@
       "remove_admin_access": "删除管理员访问权限",
       "remove_admin_access": "删除管理员访问权限",
       "cannot_remove": "您不能从管理员中删除自己",
       "cannot_remove": "您不能从管理员中删除自己",
       "give_admin_access": "授予管理员访问权限",
       "give_admin_access": "授予管理员访问权限",
-      "remove_read_only_access": "取消只读访问",
-      "give_read_only_access": "给予只读权限",
+      "revoke_read_only_access": "取消只读访问",
+      "grant_read_only_access": "给予只读权限",
       "send_invitation_email": "发送邀请邮件",
       "send_invitation_email": "发送邀请邮件",
       "resend_invitation_email": "重发邀请函"
       "resend_invitation_email": "重发邀请函"
     },
     },
@@ -1027,8 +1027,8 @@
     "ADMIN_USERS_DEACTIVATE": "停用用户",
     "ADMIN_USERS_DEACTIVATE": "停用用户",
     "ADMIN_USERS_GIVE_ADMIN": "授予管理员访问权限",
     "ADMIN_USERS_GIVE_ADMIN": "授予管理员访问权限",
     "ADMIN_USERS_REMOVE_ADMIN": "删除管理员访问权限",
     "ADMIN_USERS_REMOVE_ADMIN": "删除管理员访问权限",
-    "ADMIN_USERS_GIVE_READ_ONLY": "给予只读权限",
-    "ADMIN_USERS_REMOVE_READ_ONLY": "取消只读访问",
+    "ADMIN_USERS_GRANT_READ_ONLY": "给予只读权限",
+    "ADMIN_USERS_REVOKE_READ_ONLY": "取消只读访问",
     "ADMIN_USERS_SEND_INVITATION_EMAIL": "重发邀请函",
     "ADMIN_USERS_SEND_INVITATION_EMAIL": "重发邀请函",
     "ADMIN_USERS_REMOVE": "删除用户",
     "ADMIN_USERS_REMOVE": "删除用户",
     "ADMIN_USER_GROUP_CREATE": "创建用户组",
     "ADMIN_USER_GROUP_CREATE": "创建用户组",
@@ -1047,8 +1047,8 @@
   "toaster": {
   "toaster": {
     "give_user_admin": "Succeeded to give {{username}} admin",
     "give_user_admin": "Succeeded to give {{username}} admin",
     "remove_user_admin": "Succeeded to remove {{username}} admin",
     "remove_user_admin": "Succeeded to remove {{username}} admin",
-    "give_user_read_only": "Succeeded to give {{username}} read only",
-    "remove_user_read_only": "Succeeded to remove {{username}} read only",
+    "grant_user_read_only": "Succeeded to grant {{username}} read only",
+    "revoke_user_read_only": "Succeeded to revoke {{username}} read only",
 		"activate_user_success": "Succeeded to activating {{username}}",
 		"activate_user_success": "Succeeded to activating {{username}}",
 		"deactivate_user_success": "Succeeded to deactivate {{username}}",
 		"deactivate_user_success": "Succeeded to deactivate {{username}}",
     "remove_user_success": "Succeeded to removing {{username}}",
     "remove_user_success": "Succeeded to removing {{username}}",

+ 6 - 6
apps/app/src/client/services/AdminUsersContainer.js

@@ -231,26 +231,26 @@ export default class AdminUsersContainer extends Container {
   }
   }
 
 
   /**
   /**
-   * Give user read only
+   * Grant user read only access
    * @memberOf AdminUsersContainer
    * @memberOf AdminUsersContainer
    * @param {string} userId
    * @param {string} userId
    * @return {string} username
    * @return {string} username
    */
    */
-  async giveUserReadOnly(userId) {
-    const response = await apiv3Put(`/users/${userId}/give-read-only`);
+  async grantUserReadOnly(userId) {
+    const response = await apiv3Put(`/users/${userId}/grant-read-only`);
     const { username } = response.data.userData;
     const { username } = response.data.userData;
     await this.retrieveUsersByPagingNum(this.state.activePage);
     await this.retrieveUsersByPagingNum(this.state.activePage);
     return username;
     return username;
   }
   }
 
 
   /**
   /**
-   * Remove user read only
+   * Revoke user read only access
    * @memberOf AdminUsersContainer
    * @memberOf AdminUsersContainer
    * @param {string} userId
    * @param {string} userId
    * @return {string} username
    * @return {string} username
    */
    */
-  async removeUserReadOnly(userId) {
-    const response = await apiv3Put(`/users/${userId}/remove-read-only`);
+  async revokeUserReadOnly(userId) {
+    const response = await apiv3Put(`/users/${userId}/revoke-read-only`);
     const { username } = response.data.userData;
     const { username } = response.data.userData;
     await this.retrieveUsersByPagingNum(this.state.activePage);
     await this.retrieveUsersByPagingNum(this.state.activePage);
     return username;
     return username;

+ 8 - 8
apps/app/src/components/Admin/Users/GiveReadOnlyButton.tsx → apps/app/src/components/Admin/Users/GrantReadOnlyButton.tsx

@@ -8,16 +8,16 @@ import { toastSuccess, toastError } from '~/client/util/toastr';
 
 
 import { withUnstatedContainers } from '../../UnstatedUtils';
 import { withUnstatedContainers } from '../../UnstatedUtils';
 
 
-const GiveReadOnlyButton: React.FC<{
+const GrantReadOnlyButton: React.FC<{
   adminUsersContainer: AdminUsersContainer,
   adminUsersContainer: AdminUsersContainer,
   user: IUserHasId,
   user: IUserHasId,
 }> = ({ adminUsersContainer, user }): JSX.Element => {
 }> = ({ adminUsersContainer, user }): JSX.Element => {
   const { t } = useTranslation('admin');
   const { t } = useTranslation('admin');
 
 
-  const onClickGiveReadOnlyBtnHandler = useCallback(async() => {
+  const onClickGrantReadOnlyBtnHandler = useCallback(async() => {
     try {
     try {
-      const username = await adminUsersContainer.giveUserReadOnly(user._id);
-      toastSuccess(t('toaster.give_user_read_only', { username }));
+      const username = await adminUsersContainer.grantUserReadOnly(user._id);
+      toastSuccess(t('toaster.grant_user_read_only', { username }));
     }
     }
     catch (err) {
     catch (err) {
       toastError(err);
       toastError(err);
@@ -25,8 +25,8 @@ const GiveReadOnlyButton: React.FC<{
   }, [adminUsersContainer, t, user._id]);
   }, [adminUsersContainer, t, user._id]);
 
 
   return (
   return (
-    <button className="dropdown-item" type="button" onClick={onClickGiveReadOnlyBtnHandler}>
-      <i className="icon-fw icon-user-following"></i> {t('user_management.user_table.give_read_only_access')}
+    <button className="dropdown-item" type="button" onClick={onClickGrantReadOnlyBtnHandler}>
+      <i className="icon-fw icon-user-following"></i> {t('user_management.user_table.grant_read_only_access')}
     </button>
     </button>
   );
   );
 };
 };
@@ -35,6 +35,6 @@ const GiveReadOnlyButton: React.FC<{
  * Wrapper component for using unstated
  * Wrapper component for using unstated
  */
  */
 // eslint-disable-next-line max-len
 // eslint-disable-next-line max-len
-const GiveReadOnlyButtonWrapper: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<any>> = withUnstatedContainers(GiveReadOnlyButton, [AdminUsersContainer]);
+const GrantReadOnlyButtonWrapper: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<any>> = withUnstatedContainers(GrantReadOnlyButton, [AdminUsersContainer]);
 
 
-export default GiveReadOnlyButtonWrapper;
+export default GrantReadOnlyButtonWrapper;

+ 8 - 8
apps/app/src/components/Admin/Users/RemoveReadOnlyMenuItem.tsx → apps/app/src/components/Admin/Users/RevokeReadOnlyMenuItem.tsx

@@ -8,16 +8,16 @@ import { toastSuccess, toastError } from '~/client/util/toastr';
 
 
 import { withUnstatedContainers } from '../../UnstatedUtils';
 import { withUnstatedContainers } from '../../UnstatedUtils';
 
 
-const RemoveReadOnlyMenuItem: React.FC<{
+const RevokeReadOnlyMenuItem: React.FC<{
   adminUsersContainer: AdminUsersContainer,
   adminUsersContainer: AdminUsersContainer,
   user: IUserHasId,
   user: IUserHasId,
 }> = ({ adminUsersContainer, user }): JSX.Element => {
 }> = ({ adminUsersContainer, user }): JSX.Element => {
   const { t } = useTranslation('admin');
   const { t } = useTranslation('admin');
 
 
-  const clickRemoveReadOnlyBtnHandler = useCallback(async() => {
+  const clickRevokeReadOnlyBtnHandler = useCallback(async() => {
     try {
     try {
-      const username = await adminUsersContainer.removeUserReadOnly(user._id);
-      toastSuccess(t('toaster.remove_user_read_only', { username }));
+      const username = await adminUsersContainer.revokeUserReadOnly(user._id);
+      toastSuccess(t('toaster.revoke_user_read_only', { username }));
     }
     }
     catch (err) {
     catch (err) {
       toastError(err);
       toastError(err);
@@ -25,8 +25,8 @@ const RemoveReadOnlyMenuItem: React.FC<{
   }, [adminUsersContainer, t, user._id]);
   }, [adminUsersContainer, t, user._id]);
 
 
   return (
   return (
-    <button className="dropdown-item" type="button" onClick={clickRemoveReadOnlyBtnHandler}>
-      <i className="icon-fw icon-user-unfollow"></i> {t('user_management.user_table.remove_read_only_access')}
+    <button className="dropdown-item" type="button" onClick={clickRevokeReadOnlyBtnHandler}>
+      <i className="icon-fw icon-user-unfollow"></i> {t('user_management.user_table.revoke_read_only_access')}
     </button>
     </button>
   );
   );
 };
 };
@@ -35,6 +35,6 @@ const RemoveReadOnlyMenuItem: React.FC<{
 * Wrapper component for using unstated
 * Wrapper component for using unstated
 */
 */
 // eslint-disable-next-line max-len
 // eslint-disable-next-line max-len
-const RemoveReadOnlyMenuItemWrapper: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<any>> = withUnstatedContainers(RemoveReadOnlyMenuItem, [AdminUsersContainer]);
+const RevokeReadOnlyMenuItemWrapper: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<any>> = withUnstatedContainers(RevokeReadOnlyMenuItem, [AdminUsersContainer]);
 
 
-export default RemoveReadOnlyMenuItemWrapper;
+export default RevokeReadOnlyMenuItemWrapper;

+ 3 - 3
apps/app/src/components/Admin/Users/UserMenu.tsx

@@ -11,9 +11,9 @@ import AdminUsersContainer from '~/client/services/AdminUsersContainer';
 import { withUnstatedContainers } from '../../UnstatedUtils';
 import { withUnstatedContainers } from '../../UnstatedUtils';
 
 
 import GiveAdminButton from './GiveAdminButton';
 import GiveAdminButton from './GiveAdminButton';
-import GiveReadOnlyButton from './GiveReadOnlyButton';
+import GrantReadOnlyButton from './GrantReadOnlyButton';
 import RemoveAdminMenuItem from './RemoveAdminMenuItem';
 import RemoveAdminMenuItem from './RemoveAdminMenuItem';
-import RemoveReadOnlyMenuItem from './RemoveReadOnlyMenuItem';
+import RevokeReadOnlyMenuItem from './RevokeReadOnlyMenuItem';
 import SendInvitationEmailButton from './SendInvitationEmailButton';
 import SendInvitationEmailButton from './SendInvitationEmailButton';
 import StatusActivateButton from './StatusActivateButton';
 import StatusActivateButton from './StatusActivateButton';
 import StatusSuspendedMenuItem from './StatusSuspendMenuItem';
 import StatusSuspendedMenuItem from './StatusSuspendMenuItem';
@@ -86,7 +86,7 @@ const UserMenu = (props: UserMenuProps) => {
           {user.admin ? <RemoveAdminMenuItem user={user} /> : <GiveAdminButton user={user} />}
           {user.admin ? <RemoveAdminMenuItem user={user} /> : <GiveAdminButton user={user} />}
         </li>
         </li>
         <li>
         <li>
-          {user.readOnly ? <RemoveReadOnlyMenuItem user={user} /> : <GiveReadOnlyButton user={user} />}
+          {user.readOnly ? <RevokeReadOnlyMenuItem user={user} /> : <GrantReadOnlyButton user={user} />}
         </li>
         </li>
       </>
       </>
     );
     );

+ 6 - 6
apps/app/src/interfaces/activity.ts

@@ -151,8 +151,8 @@ const ACTION_ADMIN_USERS_PASSWORD_RESET = 'ADMIN_USERS_PASSWORD_RESET';
 const ACTION_ADMIN_USERS_ACTIVATE = 'ADMIN_USERS_ACTIVATE';
 const ACTION_ADMIN_USERS_ACTIVATE = 'ADMIN_USERS_ACTIVATE';
 const ACTION_ADMIN_USERS_GIVE_ADMIN = 'ADMIN_USERS_GIVE_ADMIN';
 const ACTION_ADMIN_USERS_GIVE_ADMIN = 'ADMIN_USERS_GIVE_ADMIN';
 const ACTION_ADMIN_USERS_REMOVE_ADMIN = 'ADMIN_USERS_REMOVE_ADMIN';
 const ACTION_ADMIN_USERS_REMOVE_ADMIN = 'ADMIN_USERS_REMOVE_ADMIN';
-const ACTION_ADMIN_USERS_GIVE_READ_ONLY = 'ADMIN_USERS_GIVE_READ_ONLY';
-const ACTION_ADMIN_USERS_REMOVE_READ_ONLY = 'ADMIN_USERS_REMOVE_READ_ONLY';
+const ACTION_ADMIN_USERS_GRANT_READ_ONLY = 'ADMIN_USERS_GRANT_READ_ONLY';
+const ACTION_ADMIN_USERS_REVOKE_READ_ONLY = 'ADMIN_USERS_REVOKE_READ_ONLY';
 const ACTION_ADMIN_USERS_DEACTIVATE = 'ADMIN_USERS_DEACTIVATE';
 const ACTION_ADMIN_USERS_DEACTIVATE = 'ADMIN_USERS_DEACTIVATE';
 const ACTION_ADMIN_USERS_SEND_INVITATION_EMAIL = 'ADMIN_USERS_SEND_INVITATION_EMAIL';
 const ACTION_ADMIN_USERS_SEND_INVITATION_EMAIL = 'ADMIN_USERS_SEND_INVITATION_EMAIL';
 const ACTION_ADMIN_USERS_REMOVE = 'ADMIN_USERS_REMOVE';
 const ACTION_ADMIN_USERS_REMOVE = 'ADMIN_USERS_REMOVE';
@@ -331,8 +331,8 @@ export const SupportedAction = {
   ACTION_ADMIN_USERS_DEACTIVATE,
   ACTION_ADMIN_USERS_DEACTIVATE,
   ACTION_ADMIN_USERS_GIVE_ADMIN,
   ACTION_ADMIN_USERS_GIVE_ADMIN,
   ACTION_ADMIN_USERS_REMOVE_ADMIN,
   ACTION_ADMIN_USERS_REMOVE_ADMIN,
-  ACTION_ADMIN_USERS_GIVE_READ_ONLY,
-  ACTION_ADMIN_USERS_REMOVE_READ_ONLY,
+  ACTION_ADMIN_USERS_GRANT_READ_ONLY,
+  ACTION_ADMIN_USERS_REVOKE_READ_ONLY,
   ACTION_ADMIN_USERS_SEND_INVITATION_EMAIL,
   ACTION_ADMIN_USERS_SEND_INVITATION_EMAIL,
   ACTION_ADMIN_USERS_REMOVE,
   ACTION_ADMIN_USERS_REMOVE,
   ACTION_ADMIN_USER_GROUP_CREATE,
   ACTION_ADMIN_USER_GROUP_CREATE,
@@ -518,8 +518,8 @@ export const LargeActionGroup = {
   ACTION_ADMIN_USERS_DEACTIVATE,
   ACTION_ADMIN_USERS_DEACTIVATE,
   ACTION_ADMIN_USERS_GIVE_ADMIN,
   ACTION_ADMIN_USERS_GIVE_ADMIN,
   ACTION_ADMIN_USERS_REMOVE_ADMIN,
   ACTION_ADMIN_USERS_REMOVE_ADMIN,
-  ACTION_ADMIN_USERS_GIVE_READ_ONLY,
-  ACTION_ADMIN_USERS_REMOVE_READ_ONLY,
+  ACTION_ADMIN_USERS_GRANT_READ_ONLY,
+  ACTION_ADMIN_USERS_REVOKE_READ_ONLY,
   ACTION_ADMIN_USERS_SEND_INVITATION_EMAIL,
   ACTION_ADMIN_USERS_SEND_INVITATION_EMAIL,
   ACTION_ADMIN_USERS_REMOVE,
   ACTION_ADMIN_USERS_REMOVE,
   ACTION_ADMIN_USER_GROUP_CREATE,
   ACTION_ADMIN_USER_GROUP_CREATE,

+ 4 - 4
apps/app/src/server/models/user.js

@@ -277,14 +277,14 @@ module.exports = function(crowi) {
     return this.save();
     return this.save();
   };
   };
 
 
-  userSchema.methods.giveReadOnly = async function() {
-    logger.debug('Give read only flag', this);
+  userSchema.methods.grantReadOnly = async function() {
+    logger.debug('Grant read only flag', this);
     this.readOnly = 1;
     this.readOnly = 1;
     return this.save();
     return this.save();
   };
   };
 
 
-  userSchema.methods.removeReadOnly = async function() {
-    logger.debug('Remove read only flag', this);
+  userSchema.methods.revokeReadOnly = async function() {
+    logger.debug('Revoke read only flag', this);
     this.readOnly = 0;
     this.readOnly = 0;
     return this.save();
     return this.save();
   };
   };

+ 16 - 16
apps/app/src/server/routes/apiv3/users.js

@@ -547,12 +547,12 @@ module.exports = (crowi) => {
    * @swagger
    * @swagger
    *
    *
    *  paths:
    *  paths:
-   *    /users/{id}/give-read-only:
+   *    /users/{id}/grant-read-only:
    *      put:
    *      put:
    *        tags: [Users]
    *        tags: [Users]
    *        operationId: ReadOnly
    *        operationId: ReadOnly
-   *        summary: /users/{id}/give-read-only
-   *        description: Give user read only access
+   *        summary: /users/{id}/grant-read-only
+   *        description: Grant user read only access
    *        parameters:
    *        parameters:
    *          - name: id
    *          - name: id
    *            in: path
    *            in: path
@@ -562,7 +562,7 @@ module.exports = (crowi) => {
    *              type: string
    *              type: string
    *        responses:
    *        responses:
    *          200:
    *          200:
-   *            description: Give user read only access success
+   *            description: Grant user read only access success
    *            content:
    *            content:
    *              application/json:
    *              application/json:
    *                schema:
    *                schema:
@@ -571,7 +571,7 @@ module.exports = (crowi) => {
    *                      type: object
    *                      type: object
    *                      description: data of read only
    *                      description: data of read only
    */
    */
-  router.put('/:id/give-read-only', loginRequiredStrictly, adminRequired, addActivity, async(req, res) => {
+  router.put('/:id/grant-read-only', loginRequiredStrictly, adminRequired, addActivity, async(req, res) => {
     const { id } = req.params;
     const { id } = req.params;
 
 
     try {
     try {
@@ -581,11 +581,11 @@ module.exports = (crowi) => {
         return res.apiv3Err(new ErrorV3('User not found'), 404);
         return res.apiv3Err(new ErrorV3('User not found'), 404);
       }
       }
 
 
-      await userData.giveReadOnly();
+      await userData.grantReadOnly();
 
 
       const serializedUserData = serializeUserSecurely(userData);
       const serializedUserData = serializeUserSecurely(userData);
 
 
-      activityEvent.emit('update', res.locals.activity._id, { action: SupportedAction.ACTION_ADMIN_USERS_GIVE_READ_ONLY });
+      activityEvent.emit('update', res.locals.activity._id, { action: SupportedAction.ACTION_ADMIN_USERS_GRANT_READ_ONLY });
 
 
       return res.apiv3({ userData: serializedUserData });
       return res.apiv3({ userData: serializedUserData });
     }
     }
@@ -599,12 +599,12 @@ module.exports = (crowi) => {
    * @swagger
    * @swagger
    *
    *
    *  paths:
    *  paths:
-   *    /users/{id}/remove-read-only:
+   *    /users/{id}/revoke-read-only:
    *      put:
    *      put:
    *        tags: [Users]
    *        tags: [Users]
-   *        operationId: removeReadOnly
-   *        summary: /users/{id}/remove-read-only
-   *        description: Remove user read only access
+   *        operationId: revokeReadOnly
+   *        summary: /users/{id}/revoke-read-only
+   *        description: Revoke user read only access
    *        parameters:
    *        parameters:
    *          - name: id
    *          - name: id
    *            in: path
    *            in: path
@@ -614,16 +614,16 @@ module.exports = (crowi) => {
    *              type: string
    *              type: string
    *        responses:
    *        responses:
    *          200:
    *          200:
-   *            description: Remove user read only access success
+   *            description: Revoke 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
+   *                      description: data of revoke read only
    */
    */
-  router.put('/:id/remove-read-only', loginRequiredStrictly, adminRequired, addActivity, async(req, res) => {
+  router.put('/:id/revoke-read-only', loginRequiredStrictly, adminRequired, addActivity, async(req, res) => {
     const { id } = req.params;
     const { id } = req.params;
 
 
     try {
     try {
@@ -633,11 +633,11 @@ module.exports = (crowi) => {
         return res.apiv3Err(new ErrorV3('User not found'), 404);
         return res.apiv3Err(new ErrorV3('User not found'), 404);
       }
       }
 
 
-      await userData.removeReadOnly();
+      await userData.revokeReadOnly();
 
 
       const serializedUserData = serializeUserSecurely(userData);
       const serializedUserData = serializeUserSecurely(userData);
 
 
-      activityEvent.emit('update', res.locals.activity._id, { action: SupportedAction.ACTION_ADMIN_USERS_REMOVE_READ_ONLY });
+      activityEvent.emit('update', res.locals.activity._id, { action: SupportedAction.ACTION_ADMIN_USERS_REVOKE_READ_ONLY });
 
 
       return res.apiv3({ userData: serializedUserData });
       return res.apiv3({ userData: serializedUserData });
     }
     }