Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ban a user through an endpoint. #7

Closed
fernandez14 opened this issue Apr 17, 2019 · 2 comments
Closed

Ban a user through an endpoint. #7

fernandez14 opened this issue Apr 17, 2019 · 2 comments
Assignees
Labels
API API related issues. feature
Milestone

Comments

@fernandez14
Copy link
Contributor

Create a new endpoint that:

  • Checks permissions to ban a user
  • Performs the ban
@RodrigoCR
Copy link
Collaborator

How was ban done before? Can I get some context? Maybe I can work on this task.

@fernandez14
Copy link
Contributor Author

fernandez14 commented Jun 10, 2019

How was ban done before? Can I get some context? Maybe I can work on this task.
@RodrigoCR ban was done by hand creating the field banned, banned_at in the user document hahahaha.

Well, now we still leverage those fields but we now use an endpoint and also we now have extended functionality through banning reasons. The banning reasons now tell the system how long a user will be banned based on custom logic from the config.hcl file, like this:

banReason spam {
    effects = <<JS
        var factor = banN || 1;
        exports = {
            duration: 60 * factor,
            ip: true,
        }
    JS
}

banReason spoofing {
    effects = <<JS
        var factor = banN || 1;
        exports = {
            duration: 60 * 24 * 7 * factor,
            ip: true,
        }
    JS
}

fernandez14 added a commit that referenced this issue Jun 10, 2019
feat(api): ban a user progress... #7
@fernandez14 fernandez14 self-assigned this Jun 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API API related issues. feature
Projects
None yet
Development

No branches or pull requests

2 participants