Class PostSecurityImpl
java.lang.Object
com.example.blogs.app.api.post.security.PostSecurityImpl
- All Implemented Interfaces:
PostSecurity
Verifies post ownership by coordinating with the post repository and security context.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
PostSecurityImpl
public PostSecurityImpl()
-
-
Method Details
-
isOwner
Checks if the authenticated user is the owner of the specified post. Verifies post existence before checking ownership.- Specified by:
isOwnerin interfacePostSecurity- Parameters:
postId- the ID of the post to check- Returns:
- true if the authenticated user owns the post, false otherwise
- Throws:
PostNotFoundException- if the post does not exist
-