1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 00:05:16 +00:00

Can delete posts

This commit is contained in:
2019-05-19 14:54:09 +02:00
parent d3f5fb6c28
commit 1fbe59c83c
4 changed files with 85 additions and 25 deletions

View File

@ -32,29 +32,29 @@ class Post implements LikeElement {
final UserAccessLevels access;
final CommentsList comments;
Post({
@required this.id,
@required this.userID,
@required this.userPageID,
@required this.groupID,
@required this.timeSent,
@required this.content,
@required this.visibilityLevel,
@required this.kind,
@required this.fileSize,
@required this.fileType,
@required this.filePath,
@required this.fileURL,
@required this.timeEnd,
@required this.linkURL,
@required this.linkTitle,
@required this.linkDescription,
@required this.linkImage,
@required this.likes,
@required this.userLike,
@required this.access,
@required this.comments
}) : assert(id != null),
Post(
{@required this.id,
@required this.userID,
@required this.userPageID,
@required this.groupID,
@required this.timeSent,
@required this.content,
@required this.visibilityLevel,
@required this.kind,
@required this.fileSize,
@required this.fileType,
@required this.filePath,
@required this.fileURL,
@required this.timeEnd,
@required this.linkURL,
@required this.linkTitle,
@required this.linkDescription,
@required this.linkImage,
@required this.likes,
@required this.userLike,
@required this.access,
@required this.comments})
: assert(id != null),
assert(userID != null),
assert(userPageID != 0 || groupID != 0),
assert(timeSent != null),
@ -69,4 +69,8 @@ class Post implements LikeElement {
bool get hasContent => content != null;
bool get hasComments => comments != null;
bool get canDelete =>
access == UserAccessLevels.FULL ||
access == UserAccessLevels.INTERMEDIATE;
}