mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 00:05:16 +00:00
Can delete posts
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user