src/main/java/za/co/grindrodbank/dokuti/document/DocumentEntity.java
public Boolean userHasPermission(UUID userId, DocumentPermission documentPermissionValue) {

		return documentPermissions.stream().anyMatch(acl -> acl.getUserId().equals(userId)
				&& acl.getPermission().equals(documentPermissionValue.toString()));

	}
/**
	 * Determines whether a user has a required permission for this document.
	 * 
	 * @param userId                  The UUID of the user to perform the check for.
	 * @param documentPermissionValue The actual value of the permission to perform
	 *                                the check for.
	 * @return true if the user has the required permission. False if the user does
	 *         not have the required permission.
	 */
Determines whether a user has a required permission for this document.

@param userId                  The UUID of the user to perform the check for.
@param documentPermissionValue The actual value of the permission to perform
the check for.
@return true if the user has the required permission. False if the user does
not have the required permission.
Determines whether a user has a required permission for this document . @param userId The UUID of the user to perform the check for . @param documentPermissionValue The actual value of the permission to perform the check for . @return true if the user has the required permission . False if the user does not have the required permission .
public Boolean userHasPermission(UUID userId, DocumentPermission documentPermissionValue) {
		return documentPermissions.stream().anyMatch(acl -> acl.getUserId().equals(userId)
				&& acl.getPermission().equals(documentPermissionValue.toString()));
	}
public Boolean userHasPermission ( UUID userId , DocumentPermission documentPermissionValue ) { return documentPermissions . stream ( ) . anyMatch ( acl -> acl . getUserId ( ) . equals ( userId ) && acl . getPermission ( ) . equals ( documentPermissionValue . toString ( ) ) ) ; }
Determines whether a user has a required permission for this document.
Determines whether a user has a required permission for this document .