-
Notifications
You must be signed in to change notification settings - Fork 3
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
Create/Update Models for Moderation #21
Comments
I think holding the banDuration as an int (seconds) would be nicer, together with DateInfracted we could always get the exact end-date of a ban by adding the seconds to the DateInfracted date (a method the DateTime class provides) So when we handle a user login we could check if they have any infractions where this calculated date is still in the future - > ergo they're still banned. This way we wouldn't need isBan, since we can simply check if banDuration is 0. (I mentioned this in #23 too) If it is, the infraction was just a warning. (this would also work if we keep it a string(check for null or empty) , so if you don't agree with the above change still consider this one) |
I definitely like that approach better, I'll fix it on the issue here. Thanks! |
One issue that we would need to think about is permanent bans, since we cant represent those this way... (unless we just set the ban duration to int.MaxValue, but that doesn't seem too clean) Just thought of this, any ideas for that? I guess we could also add a boolean isPermanent... Or just delete the User on perman bans and add their email to a blacklist? Seems a bit excessive though, since they may have submitted good combos even though they got banned and then those would be deleted. Or we set the banDuration to a negative value (-1) if its permanent and check for that, but that feels a bit hack-y... Just throwing ideas around here. |
I don't think you could have combo and comment id on report. You'll be able to access the report from the combo or comment respectively. This will stop the report object from getting unnecessarily bloated with ids. |
Yeah I was starting to feel that these models are looking messy with IDs that way. I'll remove it here. I wonder if we can just set the perma-bans to something unnecessarily long? |
We could set them to int.MaxValue and check for that, longer is impossible unless we change the data type, unless we treat the banTime not as seconds but days or something, that would work too. |
Anyway, I'll get started on this now and have a pull request up soon for review. |
We're updating the models to implement the moderation feature. I only have a few concerns about this model and if you see any problems please post them here. One primary issue is having two foreign keys for
UserId
labeled asUserId
andReporter/ModeratorId
. Please check out the UI to see how this will be implemented in #15Update User Model
int UserStatus = 1
. This model will be responsible for determining the rank of the user. 3 for admin, 2 for mods, 1 for users. Make this property private.List<Combo>Combos
. This will allow the UI to see theuser page
with all of their reports for a Combo.List<Comments>Comments
. This will allow the UI to see theuser page
with all of their reports for a commentList<Infraction>Infraction
. This will allow the UI to see theuser page
with their infractionsUpdate Combo Model
List<Report>Reports
. People will report combos*Update Comment Model
List<Report>Reports
. People will report commentsCreate Report Model
int Id
int UserId
(The id of the user being reported)int ReporterId
(The id of the creating the report)string Body
[required]DateTime DateReported = DateTime.Now()
(make this private)bool Dismiss = false
Create Infraction Model
int Id
int UserId
(The id of the user being infracted)int ModeratorId
(The id of the user/moderator giving the infraction)int banDuration = 0
(this int will be in seconds)type
[required]int Points = 0
(make this private)string body
[required]DateTime DateInfracted = DateTime.Now()
(make this private)UserId
andReporter/ModeratorId
in theReport
andInfraction
model works as foreign keys.The text was updated successfully, but these errors were encountered: