SiteUserController

struct SiteUserController : SiteControllerUtils

User Role Management

  • Declaration

    Swift

    func getShutternautsHandler(_ req: Request) async throws -> View
  • POST /userrole/shutternaut/add/:user_id

    Adds the given role to the given user’s role list. Caller must have the Shutternaut Manager role. Currently limited to adding the ‘shutternaut’ role.

    Throws

    badRequest if the target user already has the role.

    Declaration

    Swift

    func addShutternautHandler(_ req: Request) async throws -> HTTPStatus

    Return Value

    200 OK if the user now has the given role.

  • POST /userrole/shutternaut/remove/:user_id

    Removes the given role from the target user’s role list. Caller must have the Shutternaut Manager role. Currently limited to removing the ‘shutternaut’ role.

    Declaration

    Swift

    func removeShutternautHandler(_ req: Request) async throws -> HTTPStatus

    Return Value

    200 OK if the user was demoted successfully.

  • GET /directory

    Render a page to search for a users profile. Requires at least two characters of the username. Doesn’t return a whole list of users for privacy reasons.

    See more

    Declaration

    Swift

    func directoryPageHandler(_ req: Request) async throws -> View