{"size": 303, "ext": "js", "max_stars_repo_path": "server/app/middleware/role.js", "max_stars_repo_name": "vadxq/teahouse-shop", "max_stars_repo_stars_event_min_datetime": "2019-08-14T02:35:34.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-17T06:00:14.000Z", "max_issues_repo_path": "server/app/middleware/role.js", "max_issues_repo_name": "vadxq/teahouse-shop", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server/app/middleware/role.js", "max_forks_repo_name": "vadxq/teahouse-shop", "max_forks_repo_forks_event_min_datetime": "2019-09-02T03:52:05.000Z", "max_forks_repo_forks_event_max_datetime": "2019-09-02T03:52:05.000Z"}
{"max_stars_count": 4, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 14.4285714286, "max_line_length": 41, "alphanum_fraction": 0.495049505}
'use strict';

/**
 * @param app.middleware role
 */

module.exports = () => {
  return async function role(ctx, next) {
    if (ctx.current_user.role < 10) {
      ctx.body = {
        status: 401,
        success: false,
        message: '无权限',
      };
      return;
    }

    await next();
  };
};
