Class CommentSecurity
java.lang.Object
com.example.blogs.app.api.comment.security.CommentSecurity
Verifies comment ownership by coordinating with the comment repository and security context.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
CommentSecurity
public CommentSecurity()
-
-
Method Details
-
isOwner
Checks if the authenticated user is the owner of the specified comment. Verifies comment existence before checking ownership.- Parameters:
commentId- the ID of the comment to check- Returns:
- true if the authenticated user owns the comment, false otherwise
- Throws:
CommentNotFoundException- if the comment does not exist
-