Introduces admin database tables, repository, and service for managing administrators and permissions. Adds new admin routes for banning players, managing cosmetics (capes), changing player passwords and usernames, and handling player textures. Updates user and session services to support admin actions and permission checks. Adds related schema validation for new endpoints.
12 lines
477 B
JavaScript
12 lines
477 B
JavaScript
const express = require("express")
|
|
const router = express.Router()
|
|
const userService = require("../../../services/userService")
|
|
const adminService = require("../../../services/adminService")
|
|
|
|
router.patch("/:uuid", adminService.hasPermission("CHANGE_PLAYER_USERNAME"), async (req, res) => {
|
|
const { newUsername } = req.body
|
|
const result = await userService.changeUsername(req.params.uuid, newUsername)
|
|
return res.status(200).json(result)
|
|
})
|
|
|
|
module.exports = router |